OR
Returns TRUE when any supplied value evaluates to TRUE.
OR evaluates every argument left to right, as Excel does: a TRUE
does not hide a later error.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=OR(logical1, [logical2], ...)
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
logical1 | any | Required | — |
logical2 | any | Optional | — |
Accepts a variable number of arguments. Minimum: 1.
Return type
Logical (TRUE or FALSE)
Remarks
- Booleans and numbers are accepted (
0is FALSE, non-zero is TRUE). - Text and blank cells inside a reference or array are ignored.
- A direct text argument yields
#VALUE!. - The first error in argument order (ranges scanned row by row) is returned.
- With no logical values at all, the result is
#VALUE!.
Examples
Combine one true condition with one false condition.
Formula =OR(TRUE,FALSE)
Expected result TRUE
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Add a third condition and compare the result.
Formula =OR(TRUE,TRUE,FALSE)
Expected result TRUE
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Evaluate the logical operation with just one false argument.
Formula =OR(FALSE)
Expected result FALSE
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
A supplied argument evaluates to an error.
Formula =OR(TRUE,1/0)
Expected result #DIV/0!
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
One truthy value makes OR true
Formula =OR(FALSE, 0, 2)
Expected result TRUE
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
No true values and text input
Formula =OR(FALSE, "x")
Expected result #VALUE!
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
How does OR treat blanks and text?
Text and blank cells in a reference or array are ignored; a direct text argument returns #VALUE!. If nothing logical remains, OR returns #VALUE!.