In this article, you will learn about the BITOR function in Excel, the formula syntax, and usage of the function in Microsoft Excel spreadsheet.
BITOR Function in Excel
The BITOR function in Microsoft Excel performs the OR operation between two decimal numbers in its binary form and returns a decimal number. i.e., for every bit in the binary representation of the numbers, a logical OR operation is performed.
BITOR( number1, number2)
- Number1 – This should be in decimal form and greater than or equal to 0.
- Number2 – This should be in decimal form and greater than or equal to 0.
Excel 2013 and higher
When any of the argument is less than 0, BITOR returns the #NUM! error value.
When any of the argument is a non-integer or is greater than (2^48)-1, BITOR returns the #NUM! error value.
When any of the argument is a non-numeric value, BITOR returns the #VALUE! error value.
How to use the BITOR in excel worksheet?
Using this function in a WS is simple; all you need to do is enter the function as a formula of the cell in the formula bar.
Take a look at the given example
|Number 1||Number 2|
The above numbers are the binary version of some decimal numbers. To find out the BIT wise OR of the two numbers, Enter the given decimal numbers in column A and column B, enter the following formula in column C,
Formula: =BITOR (A1, B1)
Here, A1 and B1, refers to the cell name or the cell address. Repeat the same to the other cells and you will get the Bitwise OR of the two decimal numbers.
Internally, the function converts the decimal numbers into its binary values and performs the OR operation and gives the result in decimal numbers.
From the Cell A6 and B6, you can find that the corresponding value is #NUM! error, that is due to the presence of negative values or values less than 0.