
Shift bits to the right by a chosen number of positions. Useful for reducing by powers of two and pulling values out of higher bit positions.
BITRSHIFT moves the bits of a number to the right by a chosen number of positions. In practical terms, shifting right reduces the value by powers of two and drops any remainder that falls off the right side.
This is useful when a value is stored in higher bit positions and you want to bring it back down into a simpler range. It is also a fast way to do whole-number division by powers of two when you are working with bit-based data.
Moves bits into lower positions.
Returns the decimal value of the shifted bit pattern.
=BITRSHIFT(number, shift_amount)
number is the starting value. shift_amount is how many positions to move the bits.
A positive shift moves the bits to the right. A negative shift moves them left instead and behaves like BITLSHIFT. Excel still returns the result as a decimal number, so you do not have to convert it back manually after the shift.
number must be a whole number that is 0 or larger, and shift_amount must also be a whole number. Right shifts are often used to pull a value out of higher bit positions. Very large shifts can exceed Excel's supported limits and return #NUM!.
BITRSHIFT is about moving bits down, not ordinary division with decimals:
| Function | What it does | Typical use | Result |
|---|---|---|---|
BITRSHIFT |
Moves bits right | Reduce by powers of two or extract higher bits | Number |
BITLSHIFT |
Moves bits left | Scale up or place bits higher | Number |
/ |
Divides numbers normally | Regular arithmetic | Number |
BITAND |
Keeps shared bits | Mask after shifting | Number |
The easiest way to think about BITRSHIFT is that every right shift divides by 2 and drops any remainder. A shift of 1 halves the value, a shift of 2 divides by 4, and so on. That makes it useful when you want a clean whole-number result from a bit-based value.
It is also useful for extraction. If part of a number is stored in higher bits, shifting right moves that part closer to the low end where it is easier to read or combine with a mask. That is a common pattern when values are packed into one larger integer.
Microsoft also notes that BITRSHIFT works with non-negative integers up to 2^48 - 1, and if the absolute shift amount is greater than 53 Excel returns #NUM!. A negative shift amount acts like shifting left. Source: Microsoft Support, BITRSHIFT function.
One right shift divides the value by 2.
=BITRSHIFT(10, 1) // Returns 5
Shift decimal 10 right by 1 bit (/2). Formula: =BITRSHIFT(10, 1).
This brings a value stored in higher bits back down.
=BITRSHIFT(65280, 8) // Returns 255
Shift 16-bit high-value 65280 to its 8-bit base. Formula: =BITRSHIFT(65280, 8).
A shift of 4 divides the value by 2^4.
=BITRSHIFT(256, 4) // Returns 16
Shift 256 by 4 bits to divide by 16. Formula: =BITRSHIFT(256, 4).
This shows how the result is reduced with the remainder dropped.
=BITRSHIFT(7, 1) // Returns 3
Shift decimal 7 right by 1 bit. Formula: =BITRSHIFT(7, 1).
#NUM!.Tell your friends about this post