ReferenceFunctionsEngineering Functions
BITXOR
BITXOR: Returns the bitwise exclusive OR of two non-negative integers.
Summary
Keeps bits that differ between the two inputs.
Remarks
- Arguments are coerced to numbers and must be whole numbers in the range
[0, 2^48). - Returns
#NUM!for negative values, fractional values, or out-of-range values. - Propagates input errors.
Examples
Highlight differing bits
Grid
| Cell | Value | |
|---|---|---|
| No inputs on Sheet1. | ||
Formula
=
Result
Not evaluated yet.
Expected
7
XOR identical values
Grid
| Cell | Value | |
|---|---|---|
| No inputs on Sheet1. | ||
Formula
=
Result
Not evaluated yet.
Expected
0
Related functions
FAQ
Why does BITXOR(x, x) return 0?
XOR keeps only differing bits; identical operands cancel every bit position.
Runtime metadata
Category
Engineering
Signature
BITXOR(arg1: Number, arg2: Number)Arity
min 2, max 2
Arguments
arg1Number · Scalar · coercion NumberLenientText
arg2Number · Scalar · coercion NumberLenientText
Caps
PURE
Source