Hello all
I am using the formula =IF(ISNUMBER(SEARCH("Eating",B7)),"Eat",B7) and would like to combine it with something similar to this =IF(ISNUMBER(SEARCH("Drinking",B7)),"Drink",B7)
Can anyone help me with this?
Thank you
Hello all
I am using the formula =IF(ISNUMBER(SEARCH("Eating",B7)),"Eat",B7) and would like to combine it with something similar to this =IF(ISNUMBER(SEARCH("Drinking",B7)),"Drink",B7)
Can anyone help me with this?
Thank you
Hi,
Are there only two items to search, or do you require more than that? For 2 a simple nested IF will suffice:
=IF(ISNUMBER(SEARCH("Eating",B7)),"Eat",IF(ISNUMBER(SEARCH("Drinking",B7)),"Drink",B7))
but this will become quite unwieldy with multiple searches.
If you require more than just 2, you can create a lookup table in say E2:F5 or whatever.
E2:E5 would be the words to search for, i.e. Eating Drinking
F2:F5 would be the values you want returned based on finding those words, i.e. Eat Drink
Then you can use
=IFERROR(LOOKUP(2^15,SEARCH($E$2:$E$5,B7),$F$2:$F$5),B7)
Try this ...
=IFERROR(LOOKUP(2,1/SEARCH({"Eating","Drinking"},B7),{"Eat","Drink"}),B7)
Hi All
Thanks for the response. All suggestions worked great!
You're welcome.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks