OR (First, Other...) OR (First; Other...)

First

The first logical value or array of logical values.

Other

Additional logical values or arrays of logical values.

Returns

Logical Logical

TRUE if, and only if, one or more parameters are TRUE and FALSE otherwise.

Returns TRUE if one or more values are TRUE and FALSE otherwise. OR (FALSE, FALSE, FALSE) OR (FALSE; FALSE; FALSE) returns FALSE, as not a single parameter is TRUE, but OR (FALSE, TRUE, FALSE) OR (FALSE; TRUE; FALSE) returns TRUE.

Use OR, AND, NOT and XOR in conjunction with IF to express logical conditions.

This formula returns 2 if Value1 is 20 or Value2 is 40, and 4 otherwise:

IF ( OR (Value1 = 20, Value2 = 40), 2, 4)
IF ( OR (Value1 = 20; Value2 = 40); 2; 4)

The formula can also be written using the || operator (which is not commonly supported by spreadsheets):

IF ((Value1 = 20) || (Value2 = 40), 2, 4)
IF ((Value1 = 20) || (Value2 = 40); 2; 4)

|| is written between the values to test, instead of before them, which can make formulas easier to read.

Examples

IF ( OR (Value1 = 20, Value2 = 40), 2, 4)
IF ( OR (Value1 = 20; Value2 = 40); 2; 4)

Returns 2 only if Value1 is 20 or Value2 is 40. Otherwise, 4 is returned.

IF ((Value1 = 20) || (Value2 = 40), 2, 4)
IF ((Value1 = 20) || (Value2 = 40); 2; 4)

Returns 2 only if Value1 is 20 or Value2 is 40. Otherwise, 4 is returned. This example uses the || operator, which is not commonly supported by spreadsheets, instead of the OR function.

OR ({ TRUE, FALSE, TRUE })
OR ({ TRUE; FALSE; TRUE })

Returns TRUE, because at least one element of the array is TRUE.

OR ({ FALSE, FALSE, FALSE })
OR ({ FALSE; FALSE; FALSE })

Returns FALSE, because no array element is TRUE.

OR ({ FALSE, FALSE, FALSE }, FALSE, TRUE)
OR ({ FALSE; FALSE; FALSE }; FALSE; TRUE)

Returns TRUE, because the third parameter is TRUE.

fxEngine Shell Want this in your own terminal? A standalone version is coming. Get notified.
Loading fxEngine Shell