I need to look through cells in a column and mark them as true if they have the combination of "FR " or "FR" followed by 5 numbers. E.g. FR12345 or FR 12345. The "FR" related combination can be anywhere in a text string in the cell. Can someone help share a formula that would be able to mark "True" if this combination is found?
Thanks.
For strings starting in A2, use this to return TRUE/FALSE
=IF(ISNUMBER(SEARCH("FR",SUBSTITUTE(A2," ",""))),AND(LEN(SUBSTITUTE(A2," ",""))>=SEARCH("FR",SUBSTITUTE(A2," ",""))+6,NOT(ISERROR(VALUE(MID(SUBSTITUTE(A2," ",""),SEARCH("FR",SUBSTITUTE(A2," ",""))+2,5))))),FALSE)
and copy down. If you only want the True values, use
=IF(ISNUMBER(SEARCH("FR",SUBSTITUTE(A2," ",""))),IF(AND(LEN(SUBSTITUTE(A2," ",""))>=SEARCH("FR",SUBSTITUTE(A2," ",""))+6,NOT(ISERROR(VALUE(MID(SUBSTITUTE(A2," ",""),SEARCH("FR",SUBSTITUTE(A2," ",""))+2,5))))),"True",""),"")
- Edited by Bernie Deitrick, Excel MVP 2000-2010Microsoft community contributor 4 hours 6 minutes ago
For strings starting in A2, use this to return TRUE/FALSE
=IF(ISNUMBER(SEARCH("FR",SUBSTITUTE(A2," ",""))),AND(LEN(SUBSTITUTE(A2," ",""))>=SEARCH("FR",SUBSTITUTE(A2," ",""))+6,NOT(ISERROR(VALUE(MID(SUBSTITUTE(A2," ",""),SEARCH("FR",SUBSTITUTE(A2," ",""))+2,5))))),FALSE)
and copy down. If you only want the True values, use
=IF(ISNUMBER(SEARCH("FR",SUBSTITUTE(A2," ",""))),IF(AND(LEN(SUBSTITUTE(A2," ",""))>=SEARCH("FR",SUBSTITUTE(A2," ",""))+6,NOT(ISERROR(VALUE(MID(SUBSTITUTE(A2," ",""),SEARCH("FR",SUBSTITUTE(A2," ",""))+2,5))))),"True",""),"")
- Edited by Bernie Deitrick, Excel MVP 2000-2010Microsoft community contributor Saturday, May 23, 2015 3:23 AM
For strings starting in A2, use this to return TRUE/FALSE
=IF(ISNUMBER(SEARCH("FR",SUBSTITUTE(A2," ",""))),AND(LEN(SUBSTITUTE(A2," ",""))>=SEARCH("FR",SUBSTITUTE(A2," ",""))+6,NOT(ISERROR(VALUE(MID(SUBSTITUTE(A2," ",""),SEARCH("FR",SUBSTITUTE(A2," ",""))+2,5))))),FALSE)
and copy down. If you only want the True values, use
=IF(ISNUMBER(SEARCH("FR",SUBSTITUTE(A2," ",""))),IF(AND(LEN(SUBSTITUTE(A2," ",""))>=SEARCH("FR",SUBSTITUTE(A2," ",""))+6,NOT(ISERROR(VALUE(MID(SUBSTITUTE(A2," ",""),SEARCH("FR",SUBSTITUTE(A2," ",""))+2,5))))),"True",""),"")
- Edited by Bernie Deitrick, Excel MVP 2000-2010Microsoft community contributor Saturday, May 23, 2015 3:23 AM
I'm not sure what I was thinking.... ;-)
Thanks.
Bernie