GROUPBY Function
The GROUPBY function returns the summary table after grouping and aggregating by row.
This function can be used as an alternative to using a pivot table.
A pivot table only has a subset of the aggregate functions available with this function.
The results are input dynamic so the data changes the results are automatically updated.
The results will automatically spill over into adjacent cells.
![]() |
Group by 1 Column (count)
The "row_fields" corresponds to what you would drag into the "rows" block in a pivot table.
Group by 1 Column (sum)
Group all the rows in the cell range "B2:C14" by Country and display the SUM for each country.
The grand total row at the bottom is added by default
SS
Group by 1 Column (using a table)
If you want your formula to automatically show when the data changes you need to put your data into an excel table.
As soon as the data is in a table, the cell references will automatically change to "structured references"
SS
Group by 1 Column (lambda syntax)
Using the eta reduced syntax is optional.
Group by 1 Column (with headers)
make sure the selection includes the headers
Group by 1 Column (no grand total)
Group by 1 Column (total at the top)
you can apply manual formatting
Group by 1 Column (with formatting)
Use conditional formatting to format dynamically
Group by 1 Column (sort descending order)
Using a minus sign
Group by 1 Column (with filtering)
Group by 1 Column (multiple aggregates)
display multiple aggregates for the same metric / column
Use an array for mixed text and numerical
HSTACK
Group by 1 Column (remove blanks)
removing empty rows - use filter argument
Group by 1 Column (comma seperated list)
Group by 2 Columns (adjacent)
Group by 2 Columns (non adjacent)
(need to use HSTACK)
Group by 2 Columns (with subtotals)
Group by 2 Columns (sort multiple columns)
Group by 2 Columns (with Slicer)
Filter by 2 Columns
(need to use pivotby)
get unique text entries
get distinct list
sort by year and month in different columns
combining data from multiple tables
In a pivot table you cannot add a text field into the sum block.
© 2025 Better Solutions Limited. All Rights Reserved. © 2025 Better Solutions Limited TopPrevNext