If cell is x or y and z

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

Generic Formula

= IF(AND(OR(x is True, y is True), z is True),value_if_True,value_if_False)

Example

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: =IF(AND(OR(C2="Maths",C2="Science"),D2="A"),"Qualified"," ")

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.

Notes

  • 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

Our customers love us!
“The expert was absolutely amazing and stuck with me the whole way through. They were polite, patient, seemed to want to genuinely help me and provided a solution that I would never have managed otherwise. I could not be more thankful for their support and solution. Thank you!” - - Chris T, in California

Leave a Comment

avatar