BITXOR Function in Google Sheets

Perform a bitwise XOR operation on two numbers using the BITXOR function.

BITXOR Function

The BITXOR function in Google Sheets performs a bitwise XOR operation on two numeric values.

Syntax

BITXOR(value1, value2)
  • value1: The first value in the operation. This is a required parameter.
  • value2: The second value in the operation. This is also a required parameter.

Examples

  1. Basic Example

Perform a bitwise XOR operation on 12 and 5:

=BITXOR(12, 5)

This will output 9.

  1. Using BITXOR with Larger Values

Perform a bitwise XOR operation on 25 and 19:

=BITXOR(25, 19)

This will output 10.

Notes

  • The function returns a decimal number that represents the result of the bitwise XOR operation on the binary representations of the input values.
  • BITAND: Perform a bitwise AND operation on two numbers.
  • BITOR: Perform a bitwise OR operation on two numbers.