2 Dimensional Lookup to find max value and return column header

kangelosanto

New Member
Joined
Aug 12, 2014
Messages
14
So I've got this data:

ABCDE
1AAABACAD
2Name A1310
3Name B5100
4Name C2048
5Name D1100

<tbody>
</tbody>

And I can't for the life of me figure out how to achieve this:

AB
1Name AAB
2Name BAA
3Name CAC
4Name DAA -or- AB

<tbody>
</tbody>


The Value in B4 can be either AA, AB or a CONCATENATE of the two, I'm not really worried about that part as it should only happen extremely sparingly.

I tried a combination of INDEX(MATCH(MAX etc. but nothing has worked. Help!
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Try this in Sheet2 B1

=INDEX(Sheet1!$B$1:$E$1,MATCH(MAX(INDEX(Sheet1!B:E,MATCH(A1,Sheet1!A:A,0),0)),INDEX(Sheet1!B:E,MATCH(A1,Sheet1!A:A,0),0),0))
copy down

Hope this helps

M.
 
Upvote 0
Row\Col
A​
B​
C​
D​
E​
F​
G​
H​
I​
J​
1​
AA AB AC AD max headers
2​
Name A 1 3 1 0AB
3​
Name B 5 1 0 0AA
4​
Name C 2 0 4 8AD
5​
Name D 1 1 0 0AAAB

G2, control+shift+enter, not just enter, copy across, and down:
Rich (BB code):

=IF(COLUMNS($G2:G2)<=COUNTIFS($B2:$E2,MAX($B2:$E2)),
    INDEX($B$1:$E$1,SMALL(IF($B2:$E2=MAX($B2:$E2),COLUMN($B$1:$E$1)-COLUMN($B$1)+1),
    COLUMNS($G2:G2))),"")
 
Upvote 0

Forum statistics

Threads
1,215,507
Messages
6,125,212
Members
449,214
Latest member
mr_ordinaryboy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top