(Excel) Select value from column based on highest sum value of another column

43 views Asked by At

I want to figure out based on the example below which month has the highest cumulative hours. I understand selecting a value based on another, but not when I still have to find that value what per say, which would be the sum of hours for each month.

enter image description here

2

There are 2 answers

0
Mayukh Bhattacharya On

There are quite a few way of doing this perhaps for readability one could try using GROUPBY():

enter image description here


=@GROUPBY(A2:A12,B2:B12,MAX,,0,-2)

Or,

=LET(α, A2:A12, @SORT(UNIQUE(HSTACK(α,SUMIF(α,α,B2:B12))),2,-1))

Or, The following will work with Excel 2021

=INDEX(SORT(UNIQUE(CHOOSE({1,2},A2:A12,SUMIF(A2:A12,A2:A12,B2:B12))),2,-1),1,1)

0
Black cat On

With traditional functions:

Add an additional column in this case column N with the formula:

=MAX(SUMIF(L$51:L$66,L51,M$51:M$66)) drag down

and the result cell:

=INDEX(L51:M66,MATCH(MAX(N51:N66),N51:N66),1)

enter image description here