Excel - IF function with multiple words

Solved
Nick - Jan 31, 2012 at 03:56 AM
 user - Oct 8, 2019 at 02:02 PM
Hi

I'm trying to write a formula to produce a yes/no answer depending on whether the data in a previous cell in the same row contains any of the words I am trying to match.

Ie. I want the formula cell to read "Yes" if Cell B4 contains the words "Apple" or "Banana" or "Carrot", or "No" if it doesn't contain any of those words.

I am currently trying something like:

=COUNTIF(OR(B4,"*Apple*",B4,"*Banana*",B4,"*Carrot*")), "Yes","No"

(although this is rejected)

Help would be very much appreciated!
Related:

5 replies

venkat1926
Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
810
Updated on Dec 9, 2018 at 12:39 PM
try this formula

=IF(OR(
ISNUMBER(SEARCH("apple",B4)),
ISNUMBER(SEARCH("banana",B4)),
ISNUMBER(SEARCH("carrot",B4))),
"yes",
"no")
51
THX Bro
0
txs man its working good
0
thanks
0
Very helpful!
0
I have a similar issue but it's not working. Please help! Here is my formula: =IF(OR(ISNUMBER(SEARCH("melarsoprol",B2)),ISNUMBER(SEARCH("arsobal",B2)),ISNUMBER(SEARCH("melarsen",B2)),ISNUMBER(SEARCH("oxide-bal",B2)),ISNUMBER(SEARCH("mel-b",B2))),"Include","Exclude")
0