Excel OR function

How to use the Excel OR function

Description

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.

Syntax

OR( logical1, [logical2], … )

Arguments

logical1 – First condition to evaluate

logical2 – [Optional] Second condition to evaluate

Return value

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:

= OR(B6=“Memphis”, B6=“Los Angeles”, B6=“New York”, B6=“Dallas”)

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:

= OR(A1>100, E1>100)

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:

= IF(OR(A1>100, E1>100), “Good”, “Bad”)

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”:

= AND(A1>50,OR(B1=“Done”, B1=“In Progress”))

Additional Notes

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

Related Tutorials

Related Functions

How to use the Excel AND function

Excel AND function

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.

How to use the Excel XOR function

Excel XOR function

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.

How to use the Excel IF function

Excel IF function

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.

Share on pinterest
Pinterest
Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on reddit
Reddit
Share on whatsapp
WhatsApp
Share on email
Email
Share on pinterest
Share on facebook
Share on twitter
Share on linkedin
Share on reddit
Share on whatsapp
Share on email