Home > Enterprise >  Return TRUE if two conditions are met but one of them has two options
Return TRUE if two conditions are met but one of them has two options

Time:10-27

Google sheets issue. I want a formula that will return TRUE or FALSE if two conditions are met. However for one of the conditions there are two possibilities.

IF A2="Pizza OR Banana" AND B2="Food" then return TRUE

How can I go about it? For now I did the following but I am missing one option (banana):

=IF(AND($A2="Pizza"),$B2="Food")

Thank you!

CodePudding user response:

You could use a formula like

=IF(AND(OR(A2="Pizza", A2="Banana"), B2="Food"), TRUE, FALSE)

Edit: As pointed out by MattKing, you don't need the IF here at all since AND will give you TRUE/FALSE, you can just use:

=AND(OR(A2="Pizza", A2="Banana"), B2="Food")

CodePudding user response:

try:

=((A2="Pizza") (A2="Banana"))*(B2="Food")
  • Related