Excel functions / Math

BITOR function

Compares two whole numbers bit by bit and keeps the bits that are set in either.

Syntax

=BITOR(number1, number2)

Arguments

When to use it

BITOR compares two whole numbers bit by bit and keeps the bits set in either. With flags stored as bits, it switches a flag on.

Examples

  1. Switch the 2 flag on

    ABC
    1Flags
    21315

    In C2: =BITOR(A2, 2) → 15

    Try this example

Common mistakes

BITOR 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 BITOR in the playground

Related functions