Finding characters within a text

I

IgorM

Hi

How to check, using single formula, that a text within a certain cell
contains one of certain characters? For instance, how to check if there is a
'R', 'L' or 'Ps' character within cell A1 that reads 'W-RII'.

Thanks in advance
 
J

Joerg Mochikun

Hmm..not very elegant, but maybe
=NOT(AND(ISERROR(FIND("R",A1)),ISERROR(FIND("L",A1)),ISERROR(FIND("P",A1))))

Returns TRUE if the text in A1 contains 'R', 'L' or 'Ps' .
FIND is case-sensitive, use SEARCH if you also want to find lower-case
characters.

Cheers,
Joerg Mochikun
 
R

Ron Rosenfeld

Hi

How to check, using single formula, that a text within a certain cell
contains one of certain characters? For instance, how to check if there is a
'R', 'L' or 'Ps' character within cell A1 that reads 'W-RII'.

Thanks in advance

I think this will work -- returns TRUE or FALSE.


=MIN(FIND({"R","L","Ps"},A1&"RLPs"))<=LEN(A1)

Note that FIND is case-sensitive. If you need case-insensitive, use SEARCH
instead.
--ron
 

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