=IF(OR(AND(MATCH($A2,'Day 1'!$A:$A,0),MATCH($B2,'Day 1'!$B:$B,0)),AND(MATCH($A2,'Day 2'!$A:$A,0))),"YES","NO")
I have a master database in which I inserted the formula above in cell E2. My goal is to search multiple sheets (in this case “Day 1” and “Day 2”), for a person’s first and last name (first name is in A2, last name is in B2). If there is a row in any sheet where a match is found, I want a value of “YES” to be returned. . . if no match is found in any sheet, I need “NO” to be returned.
What happens with the above formula:
- If a match in sheet “Day 1” is found but there none in “Day 2”, I get an #N/A error despite the first match.
- I can never get a value of “NO” to be returned.
-
The only way “YES” is returned is if both “Day 1” and “Day 2” satisfy this piece:
AND(MATCH($A2,'Day 1'!$A:$A,0),MATCH($B2,'Day 1'!$B:$B,0)
For #3 one of my problems is that it is possible for the match I’m looking for to be in only one or both sheets.
Ultimately I’d like to have this formula look for a match in up to 7 different sheets but so far I can barely get this to work with 2.
Huge thanks in advance for your time (it is much appreciated)!
Aucun commentaire:
Enregistrer un commentaire