Description
Use this function to determine if any conditions in a set are TRUE. Supported in Chains. Can be used with CHILDREFS.
Syntax
OR(logical_1, […, logical_255])
Inputs
This function accepts the following arguments:
| Name | Required | Description | Valid input |
|---|---|---|---|
logical_1 |
Yes | The first condition or logical value to evaluate. | A cell reference, a cell range, an expression, or a formula which expresses a logical value. |
logical_n |
No | Additional conditions or logical values to evaluate. | A cell reference, a cell range, an expression, or a formula which expresses a logical value. Up to 254 additional values can be provided. |
Examples
Sample data
| A | B | |
|---|---|---|
| 1 | TRUE | FALSE |
| 2 | FALSE | FALSE |
| 3 | 15 | 20 |
| 4 | Apple | Banana |
Sample Formulas
| Use case | Formula | Explanation and Result |
|---|---|---|
| Determine if at least one of two conditions is true. | =OR(A1,B1) |
This formula works in the following manner:
For this data set this formula returns TRUE. |
| Determine if at least one of two conditions is true. | =OR(A2,B2) |
This formula works in the following manner:
For this data set this formula returns FALSE. |
| Check if a number falls within one of two conditions. | =OR(A3>10,B3<25) |
This formula works in the following manner:
For this data set this formula returns TRUE. |
| Check if any value within a specified range is true. | =OR(A1:B2) |
This formula works in the following manner:
For this data set this formula returns TRUE. |
Notes
- OR returns TRUE if any argument is TRUE, and FALSE only if all arguments are FALSE.
- The OR function can take up to 255 arguments.
- If an argument is an array or reference, only the first element is used in the evaluation.
- The OR function ignores empty cells and text values that cannot be translated into TRUE or FALSE.
- OR does not consider case when making an evaluation. For example, OR(A1="yes", A1="YES", A1="Yes") will return TRUE if A1 contains any variation of "yes", regardless of capitalization.
Tips
- Use OR in combination with IF to create more complex conditional statements.
- OR can be used with cell ranges as well as individual cells.
- When using OR with comparison operators, make sure each condition is complete. For example:
OR(A1>10,<5)should beOR(A1>10,A1<5). - In conditional formatting, OR can be useful for highlighting cells that meet any of several conditions.