Contains Text

D

DR

How do I get an if statement to return true if a cell contains a text string
rather than its being entirely composed of the string? Thanks
 
F

Frank Kabel

Hi
not quite sure what you're trying to check. Could you post an example
as plain text.
Maybe the functions
ISNUMBER
or
ISTEXT
are what you're looking for
 
T

Trevor Shuttleworth

One way:

=IF(ISERROR(SEARCH("*text*",G22)),"not found","found")

Change the text to whatever you want to look for

Regards

Trevor
 
V

Vasant Nanavati

A bit awkward, but:

=AND(NOT(ISERROR(FIND("mystring",A1))),LEN(A1)>LEN("mystring"))
 
D

DR

Thanks. I'm just trying (Excel 2000) to get a true if the cell text says
"one two" where I say
IF (A1="*two*", something, something else)
It seems not to like that syntax and is giving me the false result
 
F

Frank Kabel

Hi
the function ISNUMBEr only checks if FIND does find your text string.
You could also use the same formula with
=IF(ISNUMBER(FIND("mytexttosearchincell_A1",A1)),"something","something
else")
 
V

Vasant Nanavati

Did you try my proposed solution?

--

Vasant

DR said:
Thanks. I'm just trying (Excel 2000) to get a true if the cell text says
"one two" where I say
IF (A1="*two*", something, something else)
It seems not to like that syntax and is giving me the false result
 
D

DR

Works like a charm. Thanks. Can't believe there isn't something more
pedestrian in the app.
 

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