Forum Discussion
X128359
Jun 25, 2021Copper Contributor
IF function formula if I want 2 words to return same answer
I need an IF function formula for when I want Excel to return the word "affirmative" if the data are the words "Lima" and "Foxtrot" and return the word"negative" if not. I wanted to start a whole Vloo...
- Jun 25, 2021
Here is a formula with IF, as requested.
=IF(COUNTIF(A9,"*Lima*"),"negative",IF(COUNTIF(A9,"*Foxtrot*"),"negative",$A$5))
Also attached is an Excel file with an example.
I would be happy to know if I could help.
Nikolino
I know I don't know anything (Socrates)
* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here.
Riny_van_Eekelen
Jun 25, 2021Platinum Contributor
X128359 Not sure if you want to need AND or OR, so see which works for you.
=IF(AND(cell1="Lima",cell2="Foxtrot"),"Affirmative","Negative")
that is, two different cells need to contain the specified words.
alternatively,
=IF(OR(cell="Lima",cell="Foxtrot"),"Affirmative","Negative")
that is, the cell need to contain either of the specified words.
X128359
Jun 28, 2021Copper Contributor
Your 2nd suggestion worked very well! Simple and short! Thank you so much! I love learning from experts!