A cell will contain the words "GREEN", "YELLOW", or "RED". FWIW, the words will be surrounded by asterisks (e.g, "***GREEN***").
I am trying to craft an elegant formula that will parse the cell and return "Green", "Yellow", or "Red".
This is the formula I have so far, but it errors out if the original cell does not contain the first color ("GREEN"):
Code
=IF(FIND("GREEN",'(BC-1)'!A107)>0,"Green",IF(FIND("YELLOW",'(BC-1)'!A107)>0,"Yellow",IF(FIND("RED",'(BC-1)'!A107)>0,"Red")))
I could add "iferror" I guess, but there may be a better way?
Code
=IFERROR(IF(FIND("GREEN",'(BC-1)'!A107)>0,"Green"),IFERROR(IF(FIND("YELLOW",'(BC-1)'!A107)>0,"Yellow"),IFERROR(IF(FIND("R",'(BC-1)'!A107)>0,"Red"),"***ERROR***")))
Is there a more elegant solution? Thanks.