Formualizer Docs
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
CellValue
No inputs on Sheet1.
Formula
=
Result
Not evaluated yet.
Expected
7
XOR identical values
Grid
CellValue
No inputs on Sheet1.
Formula
=
Result
Not evaluated yet.
Expected
0

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

arg1

Number · Scalar · coercion NumberLenientText

arg2

Number · Scalar · coercion NumberLenientText

Caps

PURE

Source

On this page