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 responses

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
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")
52
THX Bro
0
txs man its working good
0