OR Function

Checks whether any of the arguments are TRUE and returns TRUE or FALSE

Functions  >  Logical  >  OR

Overview

The Excel OR function checks whether any of it’s arguments evaluate as TRUE, and returns TRUE if so.  If none of the arguments evaluate as TRUE, the function will return FALSE.  In other words, at least one argument needs to evaluate as TRUE for the OR function to return TRUE.

Syntax

=OR(logical1, [logical2], …)

Arguments

logical1 – The first condition or expression that can be evaluated to TRUE or FALSE.
logical2 – [optional] The second condition or expression that can be evaluated to TRUE or FALSE.

Version

Excel 2003

Purpose

The Excel OR function checks whether any of it’s arguments evaluate as TRUE, and returns TRUE if so.  If none of the arguments evaluate as TRUE, the function will return FALSE.

Although only one argument is required, the OR function is typically used to check multiple logical conditions at the same time.  The OR function can support up to 255 arguments, meaning 255 different logical expressions to evaluate.  Each argument must evaluate as either TRUE or FALSE, or an error will occur.

=OR(logical1, [logical2], …)

Examples

Let’s take a look at how we can use the OR function in it’s simplest form:

OR Data Set 1

The formula we have in cell E5 (and is applied to the adjacent cells in column E) is:

=OR(B5 > C5, B5 > D5)

In column E, we are looking to understand if V1 is greater than either V2 or V3.  For row 5, we see that V1 is 25, which is less than V2 at 125 and less than V3 at 75.  As such, the OR function evaluates to FALSE since V1 is not greater than V2 or V3.

However, when we get down to row 7, we see that V1 is now greater than V3.  Although it is still less than V2, only one conditions needs to evaluate as TRUE in the OR function for the OR function to return TRUE.

The OR function will always return either TRUE or FALSE, which may not be effective in communicating what you want from the function.  Instead, we can pair the OR function with the IF function:

OR Data Set 2

The formula we have in cell E5 (and is applied to the adjacent cells in column E) is:

=IF(OR(B5 > C5, B5 > D5)=TRUE, “Yes”, “No”)

Here we have combined the IF function with the OR function to change the output of the result.  Instead of the OR function returning TRUE or FALSE, now we see either “Yes” or “No” as the output.

There also may be the case where you want to see the inverse result of the OR function.  In this example, we are using the NOT function to ensure the OR function returns FALSE if any individual argument evaluates as TRUE:

OR Data Set 3

The formula we have in cell E5 (and is applied to the adjacent cells in column E) is:

=NOT(OR(B5 > C5, B5 > D5))

Here we can see the output of the OR function is opposite to what we saw in the first example, above.  Since the OR function only returns TRUE if any single argument is TRUE, combining the OR function and NOT function can be useful in situations where you want the opposite result.

Notes

  • The logical condition(s) must evaluates as either TRUE or FALSE or a #VALUE error will occur
  • Text values or empty cells entered as arguments will be ignored

Author

Kyle Stott

Kyle Stott

Certified Microsoft Excel Expert

Kyle has worked professionally with Microsoft Excel for over a decade and has been consulting on and teaching best practices in Microsoft Excel to over 400 companies across 30+ countries.

Want to learn more?

Join My Excel Academy Today!

This All-Access Pass Includes:

Excel Academy Bundle

30-Day Money-Back Guarantee

Want to learn more?

Join My Excel Academy Today!

Excel Academy Bundle

All-Access Pass Includes:

30-Day Money-Back Guarantee

Excel Academy Bundle

Want to learn more?

Join My Excel Academy Today!

30-Day Money-Back Guarantee

This all-access pass includes:

Don’t hesitate – join now!

Have any questions?

View our Frequently Asked Questions or contact us!