BITXOR

BITXOR(number1, number2)

Returns the bitwise Exclusive OR of two numbers.

number1The first number.
number2The second number.

REMARKS
* The value of each bit position is 1 when the bit positions of the parameters are different.
* If "number1" < 0, then #NUM! is returned.
* If "number2" < 0, then #NUM! is returned.
* If "number1" is not an integer, then #NUM! is returned.
* If "number2" is not an integer, then #NUM! is returned.
* If "number1" > (2^48)-1, then #NUM! is returned.
* If "number2" > (2^48)-1, then #NUM! is returned.
* If "number1" is not numeric, then #VALUE! is returned
* If "number2" is not numeric, then #VALUE! is returned
* You can use the BITAND function to return the bitwise AND of two numbers.
* You can use the BITOR function to return the bitwise OR of two numbers.
* This function was added in Excel 2013.
* For the Microsoft documentation refer to support.microsoft.com

 A
1=BITXOR(5, 3) = 6

1 - Returns the total of the bitwise "Exclusive Or" comparision at each bit position. The number 5 is 101 in binary, and 3 is 11. You can express 11 as 011 so that both numbers have 3 digits. A bitwise 'Exclusive Or' comparison checks to see if both digits at each position are not equal and, if true, returns a positive value for that position.

© 2025 Better Solutions Limited. All Rights Reserved. © 2025 Better Solutions Limited Top