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
number1: A whole number, 0 or more.number2: A second whole number, 0 or more.
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
Switch the 2 flag on
A B C 1 Flags 2 13 15 In C2:
=BITOR(A2, 2)→ 15
Common mistakes
- Adding instead. Adding 2 switches the flag on only if it was off. BITOR is safe either way.
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.
- Czech: BITOR
- Danish: BITELLER
- Dutch: BIT.OF
- Finnish: BITTI.TAI
- French: BITOU
- German: BITODER
- Hungarian: BIT.VAGY
- Italian: BITOR
- Norwegian: BITELLER
- Polish: BITOR
- Portuguese (Brazil): OULÓGICO
- Portuguese (Portugal): BIT.OU
- Russian: БИТ.ИЛИ
- Swedish: BITELLER
- Turkish: BİTVEYA