Return header of maximum value column

flammabubble

New Member
Joined
Aug 19, 2015
Messages
28
Hey guys,

So I'm using google sheets and I want to search columns E:I for whichever column has the maximum value, and then return cell 1 of that column (i.e. the header).

For example, I want the Primary column to return "Monday" as that has the maximum. If there are two which are equal I'd like it to return either both days or "Multiple"

PrimaryMondayTuesdayWednesdayThursdayFriday
Monday434231

I tried getting this to work using IF statements but it was becoming unnecessarily complicated and I'm sure there's an easier way of doing it so any recommendations would be welcome.

Thanks!
 

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"
Index and Match are good to add to your toolbox ☺

=INDEX(E$1:I$1,1,MATCH(MAX(E2:I2),E2:I2,0))
 
Upvote 0
Solution
Hi Flammabubble,

There's another forum for Google Sheets questions but here's my Excel solution.

Flammabubble#.xlsx
ABCDEFGH
1PrimaryMondayTuesdayWednesdayThursdayFridayResult
2Monday434231Monday
Sheet1
Cell Formulas
RangeFormula
H2H2=IF(COUNTIF(B2:F2,MAX(B2:F2))>1,"Multiple",INDEX(B1:F1,MATCH(MAX(B2:F2),B2:F2,0)))
 
Upvote 0
Hi Flammabubble,

There's another forum for Google Sheets questions but here's my Excel solution.

Flammabubble#.xlsx
ABCDEFGH
1PrimaryMondayTuesdayWednesdayThursdayFridayResult
2Monday434231Monday
Sheet1
Cell Formulas
RangeFormula
H2H2=IF(COUNTIF(B2:F2,MAX(B2:F2))>1,"Multiple",INDEX(B1:F1,MATCH(MAX(B2:F2),B2:F2,0)))
I could be wrong but I'm pretty sure this is the section for Google Sheets? In any case thanks for your solution!
 
Upvote 0
Another option that should work in sheets
+Fluff 1.xlsm
ABCDEF
1PrimaryMondayTuesdayWednesdayThursdayFriday
2Monday, Thursday4342431
3
Lists
Cell Formulas
RangeFormula
A2A2=TEXTJOIN(", ",,FILTER($B$1:$F$1,B2:F2=MAX(B2:F2)))
 
Upvote 0

Forum statistics

Threads
1,223,405
Messages
6,171,925
Members
452,433
Latest member
Woodchuck76

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