OR Function

The OR function is a logical function to test multiple conditions at the same time. OR returns either TRUE or FALSE. For example, to test A1 for either “x” or “y”, use =OR(A1=”x”,A1=”y”). The OR function can be used as the logical test inside the IF function to avoid extra nested IFs, and can be combined with the AND function.

Syntax

The syntax for the OR function in Microsoft Excel is:

=OR( condition1, [condition2, … condition_n] )

Parameters or Arguments

condition1

          A condition to test that can either be TRUE or FALSE.

condition2, … condition_n

          Optional. Conditions to test that can either be TRUE or FALSE.

Notes:

  1. In current versions of Excel (Excel 2007 and later), you can enter up to 255 logical_test arguments to the Excel Or function. However, in Excel 2003, the function can only handle up to 30 arguments.
  2. If the logical_test arguments evaluate to numbers, instead of logical values, the value zero is treated as FALSE and all non-zero values are treated as TRUE.

Or Function Examples

The following spreadsheet shows three examples of the Excel Or function.

In the above examples:

  • The function in cell C1 evaluates to TRUE, as BOTH of the supplied conditions are TRUE;
  • The function in cell C2 evaluates to TRUE, as the first condition, A2>0 evaluates to TRUE;
  • The function in cell C3 evaluates to FALSE, as ALL of the supplied conditions are FALSE.