...
11.3 Group by expression
Here below is a data table:
We want to group and aggregate by the first two digits of ID, and calculate the total sales of each group:
=spl("=E(?1).groups(left(ID,2):ID;sum(Sales):Sales)",A1:C25)