Index, Match, Smalls, etc. equation to return nth occurrence of a value in a row and then display column header data

sirloin16oz

New Member
Joined
Mar 5, 2019
Messages
3
Hi folks,

Need your help. I'm trying to find an equation to insert into cells E2:G5 that will look for the number of occurrences of the number “1” in a row, and then output the column header. I’ve been googling, and it seems this would require an equation using a combination of index, match, and smalls – and after two days of looking into this, I can’t figure it out.

Would really appreciate your input and help on what equation I could use.

Thank you!!!

Vince


ABCDEFG
1RedGreenBlue123
2Bob11RedGreen
3Mike11GreenBlue
4Joe111RedGreenBlue
5

<tbody>
</tbody>
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi & welcome to MrExcel
In E2 copied down & across
=IFERROR(INDEX($B$1:$D$1,AGGREGATE(15,6,COLUMN($B2:$D2)-COLUMN($B2)+1/($B2:$D2=1),COLUMNS($A:A))),"")
 
Last edited:
Upvote 0
Cross posted https://www.excelforum.com/excel-fo...ow-and-display-column-header.html#post5077395

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0
You're welcome & thanks for the feedback.

And no, MrExcel is not related to any other site.
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,447
Members
448,966
Latest member
DannyC96

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