The BITOR function in Google Sheets is designed to perform a bitwise logical OR operation on two numeric inputs. This function is particularly useful in situations where binary operations are required, enabling users to manipulate numeric data at the bit level for various applications in data analysis and programming tasks.
Syntax
BITOR(value1, value2)
- value1: The first number to be combined.
- value2: The second number to be combined.
Example #1
BITOR(3, 5)
This will calculate the bitwise OR of 3 (binary 011) and 5 (binary 101), resulting in 7 (binary 111).
Example #2
BITOR(12, 10)
This computes the bitwise OR of 12 (binary 1100) and 10 (binary 1010), yielding 14 (binary 1110).
Example #3
BITOR(0, 0)
This example evaluates the bitwise OR of two zeros, which will return 0 since there are no bits set.
Error handling
- VALUE!: Indicates that one or both values provided are not numeric. Ensure both parameters are valid numbers.
- NUM!: Suggests that one of the numbers is too large to be processed by the function. Limit the input values to avoid this error.