Practice free

BITOR function

BITOR compares two numbers bit by bit and keeps the bits that are on in either one, returning a whole number. Negative or fractional inputs return #NUM!.

Example

Read it as a sentence: compare 12 and 10 bit by bit and keep the bits that are on in either, which gives 14.

Practice this in the app

Syntax

BITOR(number1, number2)

number1 (required)
A whole number of 0 or more, below 2^48.
number2 (required)
A second whole number of 0 or more, below 2^48.

Returns: A whole number.

What Excel actually returns

Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.

FormulaExcel showsCase
=BITOR(13,25) 29 13,25
=BITOR(0,0) 0 0,0
=BITOR(2^48-1,1) 2.81475E+14 2^48-1
=BITOR("13","25") 29 Text number
=BITOR(TRUE,1) 1 TRUE
=BITOR({1,2,3},3) 3 Spill
=BITOR(-1,1) #NUM! Negative
=BITOR(1.5,1) #NUM! Decimal

Watch out for

  • Negative or fractional inputs return #NUM!.

Where it works

Excel
BITOR arrived in Excel 2013. Older versions do not have it.
Google Sheets
Same name, same behaviour for everyday use.

Part of Engineering functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .