test to see if string matches with cell content

  • Thread starter Thread starter eggman2001
  • Start date Start date
E

eggman2001

If I have the following content in a cell:
foo bar star

I'm wondering if there's a formula that will test to see if the string
"bar" exists in the cell, and then return true or false (true in this
example).
 
=isnumber(search("bar",a1))

Use =find() instead of =search() if your search should be case sensitive.

Another non-case sensitive function:
=countif(a1,"*bar*")>0

or if x99 held bar:
=countif(a1,"*"&x99&"*")>0
 
Either Find or Search will meet your needs, then check to see if a number
results, as in:
=isnumber(find("bar",a1))

Regards,
Fred
 
Back
Top