Nth Occurence, Multiple Criteria

nwillis

New Member
Joined
Aug 18, 2013
Messages
7
Hi there,

I have a question i've been stuck with for a couple of days now. My data is set up as below:


ABCDE
1BenSimonRobMike
21 Dec 16YesNoNoYes
32 Dec 16YesNoYesNo
43 Dec 16NoNoNoNo
54 Dec 16YesYesNoNo

<tbody>
</tbody>


Apologies i don't know how to paste a picutre into the box, but basically cell A1 is blank, B1 is Ben, A2 is 1 Dec16, B2 is yes etc etc

I'm trying to use a formula to find whose name contains the 2nd occurrence of 'yes' on the date 1 Dec 16. I'm using:

=INDEX($B$1:$E$1,MATCH("YES",INDEX($B$2:$E$2,MATCH("Date",$A$2:$A$5,0),0),0))

This returns 'Ben', but what i want to do is return 'Mike' as that is the 2nd occurrence of 'Yes' on that date.

Is anyone able to please help?

Thanks,
Noel
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Instead of discussing a non-working formula, care to specify the outcome you expect for the sample you posted?
 
Upvote 0
Try the CSE formula, where H1 holds the date in question

=INDEX($A$1:$E$1, 1, SMALL(IF(INDEX($A$2:$E$5, MATCH(H1, $A$2:$A$5, 0),0)="Yes", COLUMN($A$1:$E$1)), 2))

Entered with Ctrl-Shift-Enter (Cmd+Return for Mac)
 
Last edited:
Upvote 0
Instead of discussing a non-working formula, care to specify the outcome you expect for the sample you posted?

Hi Aladin,

Sorry I might not have made it clear enough but I actually said the outcome i needed in there twice, i.e. to find whose name contains the 2nd occurrence of the word 'Yes' on 1 Dec 16.

Cheers
 
Upvote 0
Try the CSE formula, where H1 holds the date in question

=INDEX($A$1:$E$1, 1, SMALL(IF(INDEX($A$2:$E$5, MATCH(H1, $A$2:$A$5, 0),0)="Yes", COLUMN($A$1:$E$1)), 2))

Entered with Ctrl-Shift-Enter (Cmd+Return for Mac)


Brilliant thanks Mike this has absolutely nailed it! I was trying to use the small function but to no avail, many thanks for your help.

Noel
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,733
Members
448,987
Latest member
marion_davis

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