Documentation/Calc Functions/OR

Function name:
OR

Category:
Logical

Summary:
Tests multiple conditions to determine whether at least one is met. TRUE is returned if at least one condition is met and FALSE is returned otherwise.

Syntax:
OR(Logical Value 1[; Logical Value 2[; … [; Logical Value 255]]])

Returns:
Returns the logical value TRUE if at least one of the supplied conditions is met and returns the logical value FALSE when none of the supplied conditions are met.

Arguments:
Logical Value 1, Logical Value 2, …, Logical Value 255 give the set of conditions to be checked. Each condition should comprise an expression that evaluates to give a logical value that is either TRUE or FALSE. If an expression evaluates to a number instead of a logical value, then the value 0 (zero) is treated as FALSE and all non-zero values are treated as TRUE. Each argument may take one of the following forms:


 * A logical value, or an expression that can be evaluated to a logical value. Examples include TRUE, 3, 1<5, 2+3=7, A2*A3, and B8<10.
 * A reference to a single cell containing a logical value or expression.
 * A reference to a cell range containing logical values or expressions (for example, D6:E12 or A1:B9~E12:E14).
 * The name of a named range, comprising cells containing logical values or expressions.
 * The name of a database range, comprising cells containing logical values or expressions.
 * An inline array of logical values or numbers (for example {TRUE, FALSE, 0, 123.456}).

Note that although OR can accept up to 255 arguments, each argument could specify a range of cells. This means that the number of conditions processed could be many more than 255.


 * If the arguments do not give at least one logical value, then OR reports a #VALUE! error.
 * If the arguments give exactly one value, then OR returns that logical value.
 * If any argument is a string in quotation marks, then OR reports a #VALUE! error. This does not apply to references to cells containing strings.
 * Empty cells and cells that contain text are ignored by OR.
 * If a cell contains an error value, then OR propagates that error irrespective of the content of other cells.

Details specific to OR function

 * In its simplest form, the logical OR (sometimes known as logical disjunction) of two logical values is an operation that produces a value of true if either of its operands are true and false otherwise. It can be expressed as a truth table as follows:


 * OR ignores any text in cells or empty cells. If you suspect wrong results, look for text within the supplied data range(s). To highlight text content within a data range, use Calc's feature.
 * Although you can use OR on its own, it is often much more useful when combined with other functions. For example, consider a value in cell A1 that you expect to be positive and a value in cell B1 that you expect to be negative. You might place a formula such as  in some other cell to check whether both values are within their expected ranges.

Related LibreOffice functions:
AND

Special:MyLanguage/Documentation/Calc_Functions/FALSE

IF

IFERROR

IFNA

IFS

NOT

SWITCH

Special:MyLanguage/Documentation/Calc_Functions/TRUE

XOR

ODF standard:
Section 6.15.8, part 2

Equivalent Excel functions:
OR