How to ask excel to refer to column title

Umbaste

New Member
Joined
Feb 11, 2022
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hello. First of all, I wish to offer an apology, since I'm not sure of how best to word my question, so I went with the best terms I could imagine. Now then, my question goes like this: I have something like this data range, detaling how many times two people eat ice cream flavors.

ABC
1VanillaStrawberry
2Adam35
3Barry62
4Adam's favorite flavor is
5Barry's favorite flavor is

In this case, how can I make excel detect the larger number for each person and then display the title of the correct column on b4 and b5?
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
You basically need MAX to get the largest value, then use something like HLOOKUP, INDEX/MATCH or XLOOKUP to find that and return the relevant header. For example:

=INDEX($B$1:$C$1,match(MAX($B2:$C2),$B2:$C2,0))

will return the header for Adam. Copy down for Barry.
 
Upvote 0
Solution
Ah. Thank you both for giving me good solutions. Yes, this was exactly what I was looking for, and I wish there was a way to mark both answers as correct. Thanks to both of you all the same.
 
Upvote 0
You're welcome.

Is it not possible that a row could have more than one equal maximum value? Or is it just that if that happens you are happy to only get the first column header that matches that maximum value?
 
Upvote 0
I thank you once more for your suggestion and your concern, but the actual dataset uses fractions of a decimal, so it's not a likely scenario. Even if it happens, just the fact Excel can detect two different factors as of equal value in the set is more than enough to provide the data I need.
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,583
Members
449,089
Latest member
Motoracer88

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