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:
How this formula works
In this formula, the logical test is this bit:
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.