Home » excel » excel – INDEX MATCH with 2 criteria, match with partial text

excel – INDEX MATCH with 2 criteria, match with partial text

Posted by: admin May 14, 2020 Leave a comment

Questions:

My data looks like this:

C.............F.............. H

Jane......Blue..........NON

Bob........Blue..........OUI

Jack.......Red..........OUI

Sarah.....Blue..........OUI

John ......Blue.........NON

Claude......Blue.........(empty)

This formula is gonna look in column C if the person has BLUE and OUI.

=IFERROR(INDEX($C$9:$C$514;MATCH(1;("BLUE"=$F$9:$F$514)*("OUI"=$H$9:$H$514);0));"AUCUN")

Output Bob

Then, I have this for the second match
=IFERROR(INDEX($C$9:$C$514;SMALL(IF($H$9:$H$514="OUI";IF($F$9:$F$514="BLUE";ROW($F$9:$F$514)-ROW(INDEX($F$9:$F$514;1;1))+1));2));"AUCUN")

Output Sarah

However, I would want the field “OUI” to be a partial text match. So whenever it finds the letter “O”, it would return a match.

So the first match would be Jane, the second match would be Bob. I tried replacing "OUI" by "*O*" but it tells me that nothing was found.

How to&Answers:

If one has the Dynamic Array formula FILTER:

=FILTER(C2:C6,(F2:F6="BLUE")*(ISNUMBER(SEARCH("O",H2:H6))))

enter image description here


If not then use INDEX(AGGREGATE())

=IFERROR(INDEX(C:C,AGGREGATE(15,7,ROW($F$2:$F$6)/(($F$2:$F$6="BLUE")*(ISNUMBER(SEARCH("O",$H$2:$H$6)))),ROW($ZZ1))),"AUCUN")

enter image description here