The Excel Bitwise functions convert the supplied integer value(s) to binary form and then perform an operation on the individual bits.
The result is then converted back to an integer value before being returned.
Further information on Bitwise operations is provided on the Wikipedia Bitwise Operation Page
The Excel BitOr function returns the bitwise 'OR' for two supplied integers.
Note: the BitOr function was only introduced in Excel 2013 and so is not available in earlier versions of Excel.
The syntax of the function is:
where the supplied number arguments are positive integers.
Formula:
|
Result:
|
In the above example:
Decimal-Binary Conversion
If you want to work through the stages of a bitwise 'OR' operation you can use the Excel DEC2BIN and BIN2DEC functions to convert between decimal and binary forms.
Formula:
|
Result:
|
In the above example:
Further information and examples of the Excel BitOr function are provided on the Microsoft Office website.
#NUM! | - |
Occurs if either:
|
#VALUE! | - | Occurs if one or both of the supplied number arguments is non-numeric. |