View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default finding occurance of characters

=MIN(IF(MID(A21,ROW(INDIRECT("1:"&LEN(A21))),1)={" B","C","D","W".},ROW(INDIR
ECT("1:"&LEN(A21)))))

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

wrote in message
oups.com...
Hi,

I have the data like the following.

ABAACADAM

I would like to find whther the letter "B" is present in it or not. So,
I used FIND("B",F25) which returned me 2.

but, my objective is to find "B","C","D","W". say for eg, if B is not
present then the letter "C" should be searched and the
occurence/position has to be returned. The order of precedence should
be maintained for the letters to be searched. i.e., if B is not found,
search for C, if not found, search for D and if not found search for W.
if nothing is present I should place 0(zero) in the resultant cell.

Is there any simple solution for this task?

thanks
Easwara