search for text within text

B

BigDave

I have a single cell that can contain up to 41 different text strings
that are like this:

-text/text/Above 1/text- where I can have Above 1, Below 1 or Below
Ground



I'm looking for a function that will tell me if that text sting
contains a certain word (like "Above 1" in the example above). I want
to use the result of that function as an argument for an IF function.
I've already used a combination LEFT/SEARCH function, but since the
text length before and after what I'm looking for (e.g. Above 1)
varies, it isn't working.

Any ideas?

TIA
 
B

Biff

Hi!

Try one of these:

=ISNUMBER(SEARCH("Above 1",A1))

Or:

=ISNUMBER(FIND("Above 1",A1))

FIND is case sensitive, SEARCH is not.

=IF(ISNUMBER(SEARCH("Above 1",A1)),do_something,do_something_else)

Biff
 
G

Guest

BigDave

Consider "=FIND("Above 1",A1)". It will give you the position in the Text
String where "Above 1" starts.
 

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