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


https://c.scudata.com/article/1651916536524
https://c.scudata.com/article/1656898103596
https://c.scudata.com/article/1656988651855