OR function

OR() function

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 

Return TRUE or FALSE statements based on testing multiple logical conditions

=OR(logical1, [logical2], ...)


Return TRUE or FALSE statements based on testing multiple logical conditions.

Return TRUE if any arguments are TRUE, FALSE if none of the arguments are TRUE.

OR syntax requires at least 1 argument, a logical condition. Up to 255 logical conditions can be tested with this function.


OR with text.

In the examples below, the OR function is used to test multiple text strings.

Use the OR function to return TRUE or FALSE statements based on testing text strings against multiple logical conditions.

Use the OR function to return TRUE or FALSE statements based on testing text strings against multiple logical conditions.

OR with numbers.

In the examples below, the OR function is used to test multiple numbers or cell references with numbers. Statements are also returned based on the result of an OR function combined with an IF function.

Use the OR function to return TRUE or FALSE statements based on testing numbers against multiple logical conditions.

Use the OR function to return TRUE or FALSE statements based on testing numbers against multiple logical conditions.

OR with dates.

In the examples below, the OR function is used to test multiple dates (essentially formatted serial numbers) and text strings.

Use the OR function to return TRUE or FALSE statements based on testing dates against multiple logical conditions.

Use the OR function to return TRUE or FALSE statements based on testing dates against multiple logical conditions.

Syntax

OR(logical1, [logical2], ...)

The OR function consists of at least 1 argument:

  1. logical1. Required. The first condition or logical value to evaluate.
  2. logical2. Optional. The second condition or logical value to evaluate.

Try it now!

  • Enter your formulas into the grey cells.

Scope

OR can be inserted into calculations to test multiple conditions.

  • Text:
 =OR(C2="Red",C3="Blue") || result is TRUE if either cell C2 contains the text string "Red" or C3 "Blue"
  • Numbers:
 =OR(1=1,2=2) || result is TRUE as 1=1 or 2=2
  • Dates:
 =OR(2/1/2022>1/1/2022,"3-Jan-2022">"2-Jan-2022") || result is TRUE for both serial number and text string dates
  • Boolean:
 =OR(TRUE,TRUE) || result is TRUE
  • Boolean:
 =OR(TRUE,FALSE) || result is TRUE as one argument returns TRUE
  • Combine with IF and AND:
 =IF(AND(OR(A1="Merry",A1="White"),B1="Christmas"),A1&" "&B1,"") || result is "Merry Christmas" or "White Christmas" if the conditions are met or an empty cell if the conditions are not met.

Caveats

  • Up to 255 logical conditions can be included in the OR function.
  • Each logical condition (logical1, logical2, etc.) or references must return TRUE or FALSE.
  • The OR function is not case-sensitive.
  • The OR function does not support wildcards.
  • The OR function will return #VALUE if no logical values are found.

Related Functions

  • AND() returns TRUE or FALSE statements if both logical conditions are met.
  • NOT() reverses the logic of an argument.

Functions Category

 


Register (for free!) or Login to access bonus materials

About xlsnippets

Learn how to master functions, charts, pivot tables and more using Excel for Microsoft Office 365. Simple instructions and embedded spreadsheets help you practise the basics.

Latest Updates

26 March 2022
26 March 2022
26 March 2022
25 March 2022
22 March 2022

Coming soon

xlsnippets.com is currently in beta version. More functions and bonus content for registered users will be added weekly. Detailed training courses with additional downloadable resources are also on the horizon!