Finding characters within a text

  • Thread starter Thread starter IgorM
  • Start date Start date
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
 
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
 
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
 
Back
Top