Excel functions / Math

BITAND function

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

Syntax

=BITAND(number1, number2)

Arguments

When to use it

BITAND compares two whole numbers bit by bit and keeps the bits set in both. With flags stored as bits, it tests whether a flag is on.

Examples

  1. Is the 4 flag on in 13?

    ABC
    1Flags
    213TRUE

    In C2: =BITAND(A2, 4)>0 → TRUE

    13 is 8 + 4 + 1.

    Try this example

Common mistakes

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

Related functions