Finding Text in Arrays, combining 2 arrays

Copper Contributor

Hello,

 

I would like to simplify the following function:

 

=IF(OR(--(COUNTIF(A2:E2;"*text1*")>0);--(COUNTIF(A2:E2;"*text2*")>0));"Yes";"No")

 

Goal: OR function that refers to an array with *text1* *text2*

 

Maybe someone can help me, thank you so much!

Lars

1 Reply

@learner1234 You could certainly shorten it.

=IF(COUNTIF(A2:E2;"*text1*")+COUNTIF(A2:E2;"*text2*");"Yes";"No")

 

In case you ever need to expand the formula with more text matches, perhaps this one is a bit easier to maintain:

=IF(SUM(IFERROR(FIND({"text1";"text2"};A2:E2),0));"Yes","No")