11.5 Enumeration grouping

 

Here below is a data table:

imagepng

The task is to put Apple, Banana and Orange in a group and name it Fruits, put Pork, Beef and Mutton in a group and name it Meats, and put the rest of the goods in a group and name it Others, and then count the total sales of each group:

=spl("=E(?1).groups(if([""Apple"",""Banana"",""Orange""].pos(Goods)!=null:""Fruits"", [""Pork"",""Beef"",""Mutton""].pos(Goods)!=null:""Meats""; ""Others""):Goods; sum(Sales):Sales)", A1:B14)

imagepng


esProc Desktop and Excel Processing
11.4 Group by segment
11.6 Put every N members in a group