SEARCH function question

cvgreports

Board Regular
Joined
Jun 28, 2006
Messages
50
I have the following formula to Search for the word "Green" and to return the value "Green" in an adjacent cell. How would I go about also looking for the word "Blue" as well and return that value if "Green" is not found.

=IF(ISERROR(SEARCH("*Green*",G4,1)),"","Green")

Thanks
 

Some videos you may like

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

njimack

Well-known Member
Joined
Jun 17, 2005
Messages
7,764
=IF(ISNUMBER(SEARCH("Green",G4)),"Green",IF(ISNUMBER(SEARCH("Blue",G4)),"Blue",""))
 

T. Valko

Well-known Member
Joined
May 9, 2009
Messages
16,623
I have the following formula to Search for the word "Green" and to return the value "Green" in an adjacent cell. How would I go about also looking for the word "Blue" as well and return that value if "Green" is not found.

=IF(ISERROR(SEARCH("*Green*",G4,1)),"","Green")

Thanks
Maybe this...

=IF(COUNTIF(G4,"*green*"),"Green",IF(COUNTIF(G4,"*blue*"),"Blue",""))
 

Watch MrExcel Video

Forum statistics

Threads
1,108,708
Messages
5,524,431
Members
409,577
Latest member
Dwg

This Week's Hot Topics

Top