test to see if string matches with cell content

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).
 
D

Dave Peterson

=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
 
F

Fred Smith

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

Regards,
Fred
 

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