# If cell is x or y and z ### Related Functions

`=IF(AND(OR(A1=x,A1=y),B1=z),"yes","no")`

You can combine logical statements with the OR and AND functions inside the IF function.

If color is yellow or red and quantity is greater than 10

In the example shown, we simply want to “mark” or “flag” records where the color is either yellow OR red AND the quantity is greater than 10.

In D5, the formula were using is this:

`=IF(AND(OR(B5="yellow",B5="red"),C5>10),"O","")`

### How this formula works

In this formula, the logical test is this bit:

`AND(OR(B5="yellow",B5="red"),C5>10)`

Note that the “parent” function is AND The OR function is logical1 inside the AND function while C5>10 is logical2.

This snippet will return TRUE only when the color in B5 is either “yellow” OR “red” AND the quantity in C5 is greater than 10.

The IF function then simply catches the result of the above snippet and returns “O” when the result is TRUE and “” (nothing) when the result is false.

Note: if we didn’t add the empty string when FALSE, the formula would actually display FALSE whenever the color is not red or yellow greater than 10.

### 0 votes. 0 / 5 .rate-title { display: none; } .rating{ padding-right: 10px; } .ratingthis{ display: -webkit-inline-box; color:#444; font-weight: bold; } 