To access the βCol1β and βCol2β labels, you can use the following:
= INDEX ($ 1: $ 1.1, COLUMN () - MOD (COLUMN () - 1,2))
Note. It is assumed that you are grouping the same number of cells. If it were three cells, you would just change the last number in the formula to 3, etc.
Edit: Here's how it works:
INDEX ($ 1: $ 1,1, x) returns the value of the cell in row 1, column x. If your table is not actually located in the upper left corner of the worksheet, you can change it to the actual range, including all of your combined shortcuts. In this case it will be: INDEX ($ A $ 1: $ D $ 1,1, x)
COLUMN () returns the column number of the current cell (1 in column A, 2 in column B, etc.)
MOD (COLUMN () - 1, x) returns the offset from the current column to the column that contains the corresponding label
source share