BITOR Function

Excel 2007+

Summary

The Excel BITOR function performs a bitwise OR operation between two decimal numbers, returning a new number where each bit position is set to 1 if either of the input numbers has a 1 in that position. This powerful function enables precise binary manipulation directly within Excel spreadsheets.

Syntax

BITOR(number1, number2)

Parameters

Parameter Type Required Description
number1 Number Yes First decimal number for bitwise OR operation (must be >= 0 and <= (2^48)-1)
number2 Number Yes Second decimal number for bitwise OR operation (must be >= 0 and <= (2^48)-1)

Using the BITOR Function

BITOR is invaluable for developers and advanced users working with binary flags, permissions, or any scenario requiring bit-level manipulation. Use it to combine multiple binary flags into a single number or check if specific bit positions are set across multiple values.

Common BITOR Examples

Basic BITOR Example

=BITOR(23,10)

Returns 31. Binary: 10111 OR 01010 = 11111 (23+8=31)

Flag Combination

=BITOR(B1,C1)

Combines permission flags from B1 and C1 into single value

Multiple Flags

=BITOR(1,2)

Combines READ (1) and WRITE (2) permissions: returns 3

Frequently Asked Questions

Decimal integers from 0 to (2^48)-1. Negative numbers or decimals cause #NUM! errors.

BITOR works at bit level (1 OR 1 = 1), while addition uses arithmetic (+1+1=2).

No, non-numeric values return #VALUE! error.

Common Errors and Solutions

#NUM!

Cause: Number < 0 or > (2^48)-1

Solution: Use numbers between 0 and 281474976710655

#VALUE!

Cause: Non-numeric input

Solution: Ensure both arguments are valid numbers

Wrong result

Cause: Confusing bitwise OR with arithmetic addition

Solution: Remember: BITOR(1,1) returns 1, not 2

Notes

  • Bits numbered right-to-left: 2^0=1, 2^1=2, 2^2=4, etc.
  • Available in Excel 2007 and later
  • Maximum value: 281,474,976,710,655
  • Use BITAND for bitwise AND operations
  • Combine with BITLSHIFT/RIGHT for complex bit manipulation

Compatibility

Available in: Excel 2007, Excel 2010, Excel 2013, Excel 2016, Excel 2019, Excel 2021, Microsoft 365

Not available in: Excel 2003 and earlier

Content last reviewed: December 9, 2025
Update frequency: As needed
Excel versions tested: Excel 2007+