In this post, you will learn about the BITXOR function, the formula syntax, and usage of the function in Microsoft Excel.
BITXOR Function in Excel
The BITXOR function in Microsoft Excel performs the XOR 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 XOR operation is performed.
Syntax
=BITXOR( number1, number2)
Arguments:
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.
Available versions
Excel 2013 and higher
Possible Errors
- When any of the argument is less than 0, BITXOR returns the #NUM! error value.
- When any of the argument is a non-integer or is greater than (2^48)-1, BITXOR returns the #NUM! error value.
- When any of the argument is a non-numeric value, BITXOR returns the #VALUE! error value.
How to use BITXOR 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
Decimal numbers:
Number 1 | Number 2 |
242 | 117 |
45 | 217 |
104 | 317 |
52 | 417 |
451 | 516 |
-158 | 217 |
The above numbers are the binary version of some decimal numbers. To find out the BIT wise XOR of the two numbers, Enter the given decimal numbers in column A and column B, enter the following formula in column C,
Formula: =BITXOR (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 XOR of the two decimal numbers.
Internally, the function converts the decimal numbers into its binary values and performs the XOR 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.