Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
=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 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Another play to try ..
Put in say, G25: =IF(ISERROR(FIND("B",F25)),IF(ISERROR(FIND("C",F25 )),IF(ISERROR(FIND("D",F25 )),IF(ISERROR(FIND("W",F25)),0,FIND("W",F25)),FIND ("D",F25)),FIND("C",F25)), FIND("B",F25)) -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- 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 |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks Bob & Max!! Both solutions works!! :)
You guys Rock!! |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
wrote
Thanks Bob & Max!! Both solutions works!! :) You guys Rock!! You're welcome ! Thanks for the feedback But .. there might be some subtle differences <g ... is the order of precedence check still important?, re your: ... 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 .. place 0 (zero) in the resultant cell. I tested with, say the data: AWAACADAM Bob's returns: 2 ("W"), while mine returns: 5 ("C") With say: AADAMBMM Bob's returns: 3 ("D"), while mine returns: 6 ("B") -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I control the length of characters a code will return? | Excel Discussion (Misc queries) | |||
Finding cells with a specific number of characters | Excel Discussion (Misc queries) | |||
Formula to replace invalid filename characters | Excel Worksheet Functions | |||
Help - Can't directly input Japanese characters into cell | Excel Discussion (Misc queries) | |||
Finding & Capturing First Occurance | Excel Worksheet Functions |