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

sirloin16oz

New Member
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

 A B C D E F G 1 Red Green Blue 1 2 3 2 Bob 1 1 Red Green 3 Mike 1 1 Green Blue 4 Joe 1 1 1 Red Green Blue 5

<tbody>
</tbody>

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Fluff

MrExcel MVP, Moderator
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:

Fluff

MrExcel MVP, Moderator

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.

sirloin16oz

New Member
This is great. Thanks so much!!!

sirloin16oz

New Member
Oops. Sorry. I thought mrexcel and excelforum were related. Thanks for the heads-up!

Fluff

MrExcel MVP, Moderator
You're welcome & thanks for the feedback.

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

Replies
10
Views
182
Replies
5
Views
92
Replies
1
Views
194
Replies
5
Views
280
Replies
3
Views
261

1,109,436
Messages
5,528,758
Members
409,834
Latest member
vexceled

This Week's Hot Topics

• Change military grades into rank
Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
• VBA COUNTIF SOLUTION
Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
• INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...