SoftTimur
SoftTimur

Reputation: 5510

Dynamic formulas for match with several criteria (one by one)

Previously, I posted a question about Dynamic formulas for match with several criteria. The idea of the answer is to use & to combine columns.

But I would prefer a solution where we really check criteria in several columns one by one. Here is an example:

enter image description here

The raw data is in B3:C8. F2 is =UNIQUE(RIGHT(B3:B8,LEN(B3:B8)-5)), so it dynamically extracts all the people. G1:I1 is manually entered. By using =ISNUMBER(XMATCH(1,("who: "&$F2=$B$3:$B$8)*(G$1=$C$3:$C$8),0,)) in G2 and copying it to G2:I4, we could well fill in the table and find if a person has a fruit. So that's good.

I would like to make this formula dynamic. I tried =ISNUMBER(XMATCH(1,("who: "&$F2#=$B$3:$B$8)*(G$1=$C$3:$C$8),0,)) in G2, but it did not spill (anyone knows why?).

So does anyone have a dynamic solution (without lambda function if possible), whose structure contains ("who: "&$F2=$B$3:$B$8)*(G$1=$C$3:$C$8)? I prefer this structure to & because we could really write any expression for criteria one by one.

Upvotes: 0

Views: 228

Answers (1)

Scott Craner
Scott Craner

Reputation: 152505

I would use COUNTIFS:

=COUNTIFS(B:B,"=*"&F2#,C:C,"="&G1#)>0

enter image description here


Or you can use:

=ISNUMBER(XMATCH("*"&F2#&G1#,B:B&C:C,2))

enter image description here

Upvotes: 2

Related Questions