Home »
Excel-Built-In-Functions »
Excel-Logical-Functions »
Excel-Or-Function
The Excel OR Function
Related Function:
AND Function
Function Description
The Excel OR function tests a number of supplied conditions and returns either:
- TRUE if ANY of the conditions evaluate to TRUE
or
- FALSE otherwise (i.e. if ALL of the conditions evaluate to FALSE).
The syntax of the function is:
OR( logical_test1, [logical_test2], ... )
where the logical_test arguments are one or more conditions that
evaluate to either TRUE or FALSE.
Notes:
-
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.
-
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.
Excel Or Function Examples
The following spreadsheet shows three examples of the Excel Or function.
Formulas:
|
A |
B |
C |
1 |
5 |
10 |
=OR( A1>0, A1<B1 ) |
2 |
5 |
10 |
=OR( A2>0, A2>B2, B2>12 ) |
3 |
5 |
10 |
=OR( A3<0, A3>B3, B3>12 ) |
|
Results:
|
A |
B |
C |
1 |
5 |
10 |
TRUE |
2 |
5 |
10 |
TRUE |
3 |
5 |
10 |
FALSE |
|
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.
For further examples of the Excel Or function, see the
Microsoft Office website.
Excel Or Function Error
The most common error from the Excel Or Function is the #VALUE! error:
Common Error
#VALUE! |
- |
Occurs if any of the supplied logical_test cannot
be interpreted as numeric or logical values.
|