Test multiple conditions at the same time
=OR(logical1, [logical2], ...)
| Parameter | Description |
|---|---|
logical1 |
The first condition or logical value to evaluate. |
logical2 |
[optional] The second condition or logical value to evaluate. |
The purpose of the OR function is to evaluate more than one logical test at the same time and return TRUE if any result is TRUE. Excel's OR function c
=OR(FALSE,FALSE,TRUE) // returns TRUE
If all conditions are FALSE, OR will return FALSE:
=OR(FALSE,FALSE,FALSE) // returns FALSE
Typically, logical arguments are provided to OR as logical expressions, for example:
=OR(A1>0,A1<5)
=OR(A1>0,B1>0)
=OR(A1="red",B1="small")
All expressions in the formulas above will be evaluated as TRUE or FALSE. Notice that text values used in comparisons must be enclosed in double quote
=OR(0,0,3) // returns TRUE
=OR(0,0,0) // returns FALSE
You can use OR to test for one of several values. For example, in the worksheet below, we are using the OR function to test if the codes in column B a
=OR(B5=115,B5=120,B5=125)
The OR function is often embedded inside the IF function as the logical test to simplify what would otherwise be a more complex formula. For example,
=IF(OR(B5<750,C5<750),"Deny","Approve")