Excel functions / Math

BITXOR function

Compares two whole numbers bit by bit and keeps the bits that are set in one but not the other.

Syntax

=BITXOR(number1, number2)

Arguments

When to use it

BITXOR keeps the bits set in exactly one of two whole numbers. It flips a flag: on becomes off, off becomes on.

Examples

  1. Flip the 4 flag

    ABC
    1Flags
    2139

    In C2: =BITXOR(A2, 4) → 9

    Try this example

Common mistakes

BITXOR in other languages

Excel shows function names in its own language. In these languages it also puts a semicolon between arguments where English has a comma.

Translate a whole formula

Try BITXOR in the playground

Related functions