11.6 Put every N members in a group
Here below is a data table:
We want to put every 4 rows in order in a group, and calculate the serial number of group and the sum of the values in the second column of each group:
=spl("=E@b(?1).groups((#-1)\4+1:ID;sum(#2):Total)",A1:B12)
To put every 4 rows in a group, we can group by the result of (#-1)\4+1, that is, subtract 1 from row number # to get the difference, divide the difference by 4 to get the quotient, and add 1 to the quotient. After grouping, we can count the sum of the values in the second column of each group.
esProc Desktop and Excel Processing
11.5 Enumeration grouping
11.7 Convert one-dimensional array to two-dimensional array
SPL Official Website 👉 https://www.scudata.com
SPL Feedback and Help 👉 https://www.reddit.com/r/esProc_Desktop/
SPL Learning Material 👉 https://c.scudata.com
Discord 👉 https://discord.gg/cFTcUNs7
Youtube 👉 https://www.youtube.com/@esProcDesktop
Linkedin Group 👉 https://www.linkedin.com/groups/14419406/