#41 β Group And Summarize Rows While Retaining Columns Whose Values Are Unchanged
Judith-Excel-Sharing
Posted on August 8, 2024
Problem description & analysis:
In the Excel table below, the ID column is the category; Value1 and Value2 contain numbers; both Descr 1 and Descr 2 remain unchanged under the same ID value.
This is an older version of Excel (which does not support groupby function). Task: Group rows by ID and sum the Value1 field and Value2 field while retaining the Descr 1 field and Descr 2 field.
Solution:
Use SPL XLL to get this done:
=spl("=E(?).groups(ID;sum('Value 1'):'Value 1',sum('Value 2'):'Value 2','Descr 1','Descr 2')",A1:E10)
As shown in the picture below:
E()function converts a data arrangement to a table. groups() function groups and summarizes the table, during which a newly generated column can be renamed through the semicolon.
π πͺ π
π©
Judith-Excel-Sharing
Posted on August 8, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
productivity #45 β Copy Each Row N Times (N Is The Cell Value of The Specified column)
August 15, 2024