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
number1: A whole number, 0 or more.number2: A second whole number, 0 or more.
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
Is the 4 flag on in 13?
A B C 1 Flags 2 13 TRUE In C2:
=BITAND(A2, 4)>0→ TRUE13 is 8 + 4 + 1.
Common mistakes
- Negative or decimal numbers. Only whole numbers from 0 up are allowed: others give #NUM!.
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.
- Czech: BITAND
- Danish: BITOG
- Dutch: BIT.EN
- Finnish: BITTI.JA
- French: BITET
- German: BITUND
- Hungarian: BIT.ÉS
- Italian: BITAND
- Norwegian: BITOG
- Polish: BITAND
- Portuguese (Brazil): ELÓGICO
- Portuguese (Portugal): BIT.E
- Russian: БИТ.И
- Spanish: BIT.Y
- Swedish: BITOCH
- Turkish: BİTVE