The Excel OR function is a logical function that is used to check if at least one of multiple conditions is evaluate TRUE. OR returns TRUE one or more conditions evaluate TRUE, if no condition evaluates TRUE it returns FALSE. OR is often used inside the IF function or combined with the AND function.
OR( logical1, [logical2], … )
logical1 – First condition to evaluate
logical2 – [Optional] Second condition to evaluate
TRUE if at least one conditions evaluate TRUE. Otherwise FALSE.
How to use the OR function in Excel
Use the OR function to check if at least one of multiple conditions is TRUE.
In the above example, we use the OR function to test if the cell value in B6 is equal to a city name in the USA. With the OR function we compare it to multiple US city names. Only one of these logical tests has to evaluate TRUE to make the OR function also return TRUE:
In a similar way you can also use the OR function to run tests on multiple cells at once. To test if the value in A1 or the value in E1 is greater than 100, use the following formula:
The OR function is often used to extend the functionality of other functions like the IF function. You can put the above expression inside an IF statement as the logical test, and then specify the return values depending on what the OR statement returns:
In addition, the OR function can be easily combined with the AND function. The formula below returns TRUE if A1 > 50 and B1 equals “Done” or “In Progress”:
If you supply text values or empty cells as argument they will be ignored.
Be careful: If no logical values are found the OR function will return a #VALUE error.
AND formula examples
The Excel AND function is a logical function that is used to check multiple conditions at the same time. AND returns TRUE if all conditions evaluate TRUE.
The Excel IF function allows you to perform a simple logical test and returns one value for a TRUE result, and another value for a FALSE result.
The Excel XOR function returns an “exclusive OR” of all arguments. For two logical arguments, XOR returns TRUE if either one of both arguments is TRUE.