top of page

Excel Arena

This is the place, where we can test the boundaries of Excel functions.

Descriptive Header in GROUPBY Function - Excel

It is possible to include multiple aggregate columns within the function argument of the GROUPBY function, as demonstrated below:

HSTACK(SUM,PERCENTOF) 

ree

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"}))

Recent Posts

See All
Recursion in Excel and Power Query

In this post, I will demonstrate recursion in Excel and Power Query with some basic examples. Example 1: You are on a set of stairs that...

 
 
 
  • LinkedIn
  • Facebook
  • Twitter
  • Instagram
bottom of page