The OR function in Google Sheets is a powerful logical operator used to evaluate multiple conditions. It returns true if any of the supplied arguments evaluate to true, making it an essential tool for decision-making and data analysis within your spreadsheets.
Syntax
OR(logical1, [logical2, ...])
- logical1: The first condition or expression that you want to evaluate.
- logical2: Optional. Additional conditions or expressions to evaluate; you can include multiple logical arguments.
Example #1
OR(A1 > 10, B1 < 5)
In this example, if cell A1 contains a value greater than 10 or cell B1 contains a value less than 5, the function returns true. For instance, if A1 = 15 and B1 = 3, the result would be true.
Example #2
OR(C1 = "Yes", D1 = "Maybe")
This function checks if cell C1 contains "Yes" or D1 contains "Maybe". For example, if C1 = "No" and D1 = "Maybe", the result would be true.
Example #3
OR(E1 = 0, F1 = 0, G1 = 0)
Here, the function evaluates if any of the cells E1, F1, or G1 contain zero. If E1 = 2, F1 = 0, and G1 = 5, the result will be true because F1 is zero.
Error handling
- VALUE!: This error occurs when non-logical values are provided to the function, making it impossible to evaluate the conditions.
- N/A: This error indicates that the function encountered an invalid argument or cell reference.