How do I evaluate whether a character is present in a cell?

C

Crash

I am hoping I can evaluate whether a specific character is present in the
text of a cell using an If function.

For example if I test for a forward-slash in a cell containing the text
abc/def I want a TRUE result but in a cell containing the text abcdef I want
a FALSE result.

Is this possible?
 
T

Tom Hutchins

Actually, you don't even need to use IF:

=LEN(A1)>LEN(SUBSTITUTE(A1,"/",""))

will return TRUE if A1 contains / or FALSE if it doesn't.

Hope this helps,

Hutch
 
R

Ron Rosenfeld

I am hoping I can evaluate whether a specific character is present in the
text of a cell using an If function.

For example if I test for a forward-slash in a cell containing the text
abc/def I want a TRUE result but in a cell containing the text abcdef I want
a FALSE result.

Is this possible?


=ISNUMBER(SEARCH("/",A1))
=ISNUMBER(FIND("/",A1))

If you are looking for a letter, SEARCH is case-insensitive; FIND is
case-sensitive.

Also look up HELP for wildcards in case you need to find one of them.
--ron
 
J

Jacob Skaria

Use FIND() or SEARCH().

=ISNUMBER(FIND("/",A1))

=IF(ISNUMBER(FIND("/",A1)),"true statement","false statement")

If this post helps click 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