Can I use 'CONTAINS' in an IF Logical Test?

G

Guest

I want to use the IF function, but using a Logical Test on a given cell that
contains text, like 'Red; Green; Blue'. The cell may contain all, none, or
any of these words. If the cell contains Red, I want to Return Yes

My Function would look something like

=IF (Q2 CONTAINS "RED", "Yes", "No")

However, I only see IF working on numbers and not text.

Any ideas?

Thanks.

Mike
 
J

JE McGimpsey

One way:

=IF(COUNTIF(Q2,"*RED*"),"Yes","No")

another:

=IF(ISERR(SEARCH("RED",Q2)),"No","Yes")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top