Good deal!
I guessed correctly.
In the attached find (now un hidden) a helper column A. This formula repeats the merged row headers.
Formula:
=IF(B37="",A36,B37)
I figured out the M F headers and their role in the output columns. In D37:H41
Formula:
=INDEX($C$3:$O$30,MATCH($A37,$B$3:$B$30,0)-1+MATCH($C37,$B$3:$B$30,0),
MATCH(LOOKUP("zzzzz",$D$35:D$35),$C$1:$O$1,0)-1+MATCH(D$36,$C$2:$O$2,0))
With that range selected copy and paste into cells D43, D49, D55, J37, J43, J49 and J55.
For the subtotals by M and F in I37:I41
Formula:
=INDEX($C$3:$O$30,MATCH($A37,$B$3:$B$30,0)-1+MATCH($C37,$B$3:$B$30,0),
MATCH(2,INDEX(1/(LOOKUP("zzzzz",$D$35:D$35)=$C$1:$O$1),0),1))
Then copy that range and paste into the remaining relative cells columns I and O. The formula subtotals for each A, B, C ... E
and gender subtotals are self explanatory. Again copy the first range and paste into relevant cells.
I assume you know how to hide column A if desired.
Bookmarks