Find 2nd and 3rd highest numbers in a row and return column header

centaur87

New Member
Joined
May 9, 2016
Messages
13
ETF-AETF-BETF-CETF-D
10271111

<tbody style="box-sizing: inherit; border: 0px; margin: 0px; padding: 0px; vertical-align: top; -webkit-font-smoothing: antialiased; text-size-adjust: none;">
</tbody>
[FONT=&quot]I cannot seem to write the formula that would return the column header of the second largest value.

In above Case, first Largest value is 27, it will return ETF-B
But 2nd largest has duplicate values, hence what formula shall i write to return [/FONT]
[FONT=&quot]the column header of the second largest value.

Best Regards.
[/FONT]
 
A
B
C
D
E
F
1
ETF-AETF-BETF-CETF-D
27​
ETF-B
2
10​
27​
11​
11​
11​
ETF-C,ETF-D
3
10​
ETF-A
4
0​
Excel 2016 (Windows) 32 bit
E
F
1
=MAX($A$2:$D$2)​
=TEXTJOIN(",",1,IF($A$2:$D$2=E1,$A$1:$D$1,""))
2
=MAX(IF($A$2:$D$2<E1,$A$2:$D$2))​
=TEXTJOIN(",",1,IF($A$2:$D$2=E2,$A$1:$D$1,""))
3
=MAX(IF($A$2:$D$2<E2,$A$2:$D$2))​
=TEXTJOIN(",",1,IF($A$2:$D$2=E3,$A$1:$D$1,""))
4
=MAX(IF($A$2:$D$2<E3,$A$2:$D$2))​
=TEXTJOIN(",",1,IF($A$2:$D$2=E4,$A$1:$D$1,""))
Sheet: Sheet1


Formula in F1 is array so you have to accept it with Ctrl+Shift+Enter not just Enter.
 
Last edited:
Upvote 0

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,214,905
Messages
6,122,172
Members
449,071
Latest member
cdnMech

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