# Excel - IF function with multiple words [Closed]

Ask a question Nick - Last answered on Aug 1, 2017 at 02:00 PM by Mike
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!
+34
try this formula

=IF(OR(ISNUMBER(SEARCH("apple",B4)),ISNUMBER(SEARCH("banana",B4)),ISNUMBER(SEARCH("carrot",B4))),"yes","no")
vj-
txs man its working good
suresh-
thanks
bc622-
pharm-
Mike-
+25
=IF(OR(B4="apple",B4="Banana",B4="carrot"),"yes","no")
so bored-
you need to use ; instead of ,
+11
Ie. It gives "No" when "apple" (for example) is in the cell, because other words are also in the cell... for example "Red apple" will show as "No" because the cell doesn't = "apple", it contains "apple".

I meant wildcard as in searching for "apple" among all words in the cell.
+7
Thanks venkat.

That is giving me a negative response where I should have a positive response, as the cell may contain words other than "apple" or "banana" or "carrot" aswell...

I think I need some kind of "wildcard" or "contains" search...?
+3
"giving me a negative response" please explain with example

wildcard means some common phrases = nothing between apple and Banana

make your requirements little more clearer.
I wonder whether excel can work like a spell check

Member requests are more likely to be responded to.

Members can monitor the statuses of their requests from their account pages.