Formula to return the max value and corresponding column header

shady moustafa

New Member
Joined
Dec 21, 2021
Messages
3
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi All,

I am looking for a way to search for the maximum value in a range and returns the name of the column which includes the identified value. I am attaching a screenshot of an example table, and the desired output below the table.

Example screenshot.PNG



The output of the exercise will be the following:

(Cell B15 includes the criteria)
1- Cell C15 to include The maximum value from the range
2 Cell D15 to include the name of the column

Thank you
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
This will handle a tie reasonably well.
MrExcelPlayground5.xlsx
ABCDE
1
2
3JanFebMar
4A100
5B020
6C003
7A010020
8B246
9C1001010
10A000
11B502030
12C103010
13
14
15OutputA, C100Feb, Jan
Sheet27
Cell Formulas
RangeFormula
B15B15=TEXTJOIN(", ",TRUE,IF(INDEX(C4:E12,SEQUENCE(ROWS(C4:E12)),SEQUENCE(1,COLUMNS(C4:E12)))=C15,B4:B12,""))
C15C15=MAX(C4:E12)
D15D15=TEXTJOIN(", ",TRUE,IF(INDEX(C4:E12,SEQUENCE(ROWS(C4:E12)),SEQUENCE(1,COLUMNS(C4:E12)))=C15,C3:E3,""))
 
Upvote 0
Reading this again, I think this is what you want:
MrExcelPlayground5.xlsx
ABCDE
1
2
3JanFebMar
4A100
5B020
6C003
7A010020
8B246
9C1001010
10A00100
11B502030
12C103010
13
14
15OutputA100Feb, Mar
Sheet27 (2)
Cell Formulas
RangeFormula
C15C15=MAX(FILTER(C4:E12,B4:B12=B15))
D15D15=TEXTJOIN(", ",TRUE,IF(INDEX(FILTER(C4:E12,B4:B12=B15),SEQUENCE(ROWS(FILTER(C4:E12,B4:B12=B15))),SEQUENCE(1,COLUMNS(FILTER(C4:E12,B4:B12=B15))))=C15,C3:E3,""))
 
Upvote 0

Forum statistics

Threads
1,215,754
Messages
6,126,680
Members
449,328
Latest member
easperhe29

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