How to lookup corresponding row and column header based on max value in table

JSM9992

New Member
Joined
Jan 29, 2015
Messages
3
Hello,

I'm trying to pull the column and row header values that correspond with the max value in the table. In this case the value of "20" in cell E3. I would like the corresponding row header "2" to show up in cell B8 and corresponding column header "4" to be in cell B9. The values will change whenever I update the table so the max value will move each time I update. I appreciate the help.


Excel 2012
ABCDEF
112345
21210543
3245112016
4332186
541571232
659513417
7
8
9
Sheet1
 
For the cell contents try...

Excel Workbook
ABCDEF
1678912
21210543
3246112016
4332186
54154512372
659535417
7
84
97
Sheet3
 
Last edited:
Upvote 0

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Or probably better...

Excel Workbook
ABCDEF
1678912
21210543
3246112016
4332186
54154512372
659535417
7
84
97
Sheet3
 
Upvote 0
I could have duplicates but the chances are very slim. The numbers I'm calculating will be in the thousands with decimals points. Side note, I used the array formula suggested by Rossa and it worked. The only thing is it appears to be calculating the actual row or column number and not the value I have in the orange highlighted section (thus the reason for having the -1 at the end of the formula). The headers in orange will actually be much larger numbers than 1-5 and I believe if they're random and not sequential that the formula might not work. However, it worked on the table I presented so all is good. Thanks for the responses!
Noted, here is an alternative to MARK858's solution(s)

Given the following:

Excel 2013
ABCDEF
1firstsecondthirdfourthlast
2one235416
3two45112016
4three32186
5four1571232
6five92013417
7
8
9
10if multiplerow headercolumn header
11max20twofourth
12fivesecond
JSM9992

Formula in B11 is a simple =MAX(B2:F6)
Formula in C11 copied down till needed is =IF(ROWS(C$11:C11)>COUNTIF($B$2:$F$6,B$11),"",INDEX(A$2:A$6,SMALL(IF($B$2:$F$6=B$11,ROW($B$2:$F$6)-ROW($B$2)+1),ROWS(C$11:C11)))) Ctrl + Shift + Enter not just Enter on a PC or Command + Return on a MAC.
Formula in D11 copied down as needed is =IF(C11="","",INDEX(B$1:F$1,MATCH(B$11,INDEX(B$2:F$6,MATCH(C11,A$2:A$6,0),0),0)))

Such would give you all data if multiple entries were found.
 
Upvote 0
The options from MARK858 and cyrilbrd both worked perfectly. Although chances of duplicates are minimal, it's nice to have the formula just in case. Thanks again everybody.
 
Upvote 0
The options from MARK858 and cyrilbrd both worked perfectly. Although chances of duplicates are minimal, it's nice to have the formula just in case. Thanks again everybody.
Most welcome. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,897
Members
449,097
Latest member
dbomb1414

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