Descriptive Header in GROUPBY Function - Excel
- V E Meganathan
- 1 day ago
- 1 min read
It is possible to include multiple aggregate columns within the function argument of the GROUPBY function, as demonstrated below:
HSTACK(SUM,PERCENTOF)

However, this approach will use the function names as headers for each column. To assign more descriptive headers, you can input a 2-dimensional array like this:
VSTACK(HSTACK(SUM,PERCENTOF),{"Total Sales","Percentage"})
In this instance,
the first row represents the aggregate functions for the new columns,
and the second row contains the headers for those columns.
Function Names as Header:
=GROUPBY(B3:B13,C3:C13,HSTACK(SUM,PERCENTOF))
Descriptive Names as Header:
=GROUPBY(B3:B13,C3:C13,VSTACK(HSTACK(SUM,PERCENTOF),{"Total Sales","Percentage"}))