IF, AND, and OR function can be used nesting together to test multiple conditions. There are many ways to test these functions. It’s up to how you want to test conditions of a value. This post will demonstrate IF a cell value has x OR y condition, AND if it also has z condition.
If cell is x or y and z
= IF(AND(OR(x is True, y is True), z is True),value_if_True,value_if_False)
Following is an example that demonstrates nested IF, AND, and OR formula. In this case, a student is qualified for the Science team IF his/her favorite subject is Maths OR Science, AND his/her level is A.
The formula in E2 is:
Figure 1 – If cell is x or y and z
The result will look like this:
Figure 2 – If cell is x or y and z
The snippet will return TRUE only when the value in C2 is either Maths OR Science AND the value in D2 is A. IF function then will return “Qualified” when a result is TRUE and “ ” (nothing) when a result is FALSE.
- If we don’t add anything for the value_if_false of IF function, it will display FALSE whenever one of the conditions is false. Like below:
Figure 3 – If cell is x or y and z