#27 — Group and Summarize A Table Where Every N Rows Consists of A Range by Column

Problem description & analysis:

Below is an Excel table. Every two rows form a range; and in each range, each pair of cells up and down is regarded as a piece of data that stores client and working hours that can be empty.

We need to find the h…


This content originally appeared on DEV Community and was authored by Judith-Excel-Sharing

Problem description & analysis:

Below is an Excel table. Every two rows form a range; and in each range, each pair of cells up and down is regarded as a piece of data that stores client and working hours that can be empty.

original tabel

We need to find the hours of work for each client.

desired table

Solution:

Use SPL XLL to do this:

=spl("=E@b(?.group((#-1)\2).conj(E@pb(~)).groups(#1;sum(#2)))",A1:G4)

As shown in the picture below:

result table with code entered
Explanation:

group()function groups rows and retains the grouping result details. groups() function performs grouping and aggregation; # represents the current sequence number in a sequence, and ~ is the current member of a sequence. E@pb converts a sequence to a table sequence without column headers.


This content originally appeared on DEV Community and was authored by Judith-Excel-Sharing


Print Share Comment Cite Upload Translate Updates
APA

Judith-Excel-Sharing | Sciencx (2024-07-17T03:00:41+00:00) #27 — Group and Summarize A Table Where Every N Rows Consists of A Range by Column. Retrieved from https://www.scien.cx/2024/07/17/27-group-and-summarize-a-table-where-every-n-rows-consists-of-a-range-by-column/

MLA
" » #27 — Group and Summarize A Table Where Every N Rows Consists of A Range by Column." Judith-Excel-Sharing | Sciencx - Wednesday July 17, 2024, https://www.scien.cx/2024/07/17/27-group-and-summarize-a-table-where-every-n-rows-consists-of-a-range-by-column/
HARVARD
Judith-Excel-Sharing | Sciencx Wednesday July 17, 2024 » #27 — Group and Summarize A Table Where Every N Rows Consists of A Range by Column., viewed ,<https://www.scien.cx/2024/07/17/27-group-and-summarize-a-table-where-every-n-rows-consists-of-a-range-by-column/>
VANCOUVER
Judith-Excel-Sharing | Sciencx - » #27 — Group and Summarize A Table Where Every N Rows Consists of A Range by Column. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/07/17/27-group-and-summarize-a-table-where-every-n-rows-consists-of-a-range-by-column/
CHICAGO
" » #27 — Group and Summarize A Table Where Every N Rows Consists of A Range by Column." Judith-Excel-Sharing | Sciencx - Accessed . https://www.scien.cx/2024/07/17/27-group-and-summarize-a-table-where-every-n-rows-consists-of-a-range-by-column/
IEEE
" » #27 — Group and Summarize A Table Where Every N Rows Consists of A Range by Column." Judith-Excel-Sharing | Sciencx [Online]. Available: https://www.scien.cx/2024/07/17/27-group-and-summarize-a-table-where-every-n-rows-consists-of-a-range-by-column/. [Accessed: ]
rf:citation
» #27 — Group and Summarize A Table Where Every N Rows Consists of A Range by Column | Judith-Excel-Sharing | Sciencx | https://www.scien.cx/2024/07/17/27-group-and-summarize-a-table-where-every-n-rows-consists-of-a-range-by-column/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.