11.8 Take adjacent data as grouping criteria

 

Here below is a data table:

imagepng

The task is to group the data in the first column, and calculate the sum of the values in the second column of each group. Grouping criteria: when there is a difference of 5 or more between the current data and previous one, create a new group:

=spl("=E@b(?1).group@i(#1-#1[-1]>=5).new(#1:ID,~.sum(#2):Total)",A1:B12)

imagepng


esProc Desktop and Excel Processing
11.7 Convert one-dimensional array to two-dimensional array
11.9 Group when meeting blank row