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>
 

Some videos you may like

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
Joined
Jun 12, 2014
Messages
46,578
Office Version
  1. 365
Platform
  1. Windows
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
Joined
Jun 12, 2014
Messages
46,578
Office Version
  1. 365
Platform
  1. Windows
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.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
46,578
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.

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

Watch MrExcel Video

Forum statistics

Threads
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...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top