Grouping stacked pieces

If I have 4 types of pieces: small red, large red, small blue, large blue. They can all be “grouped” (I guess it is a stack). How can I do the following:

In a irregular area, make the pieces overlap in two separate groups: small with small and large with large, one besides the other (instead of on top).

When this group is moved, it should report the total number of each type of piece instead of each unit individually, e.g,: “2x small red, 3x small blue, 4x large blue”, or even “5 small, 4 large” (ignoring color).