
In this article
BITRSHIFT shifts a number’s bits right, the same as integer division by a power of 2. Used to read packed flags and bit fields.
Advertisement
Syntax
=BITRSHIFT(number, shift_amount)
| Argument | What it means |
|---|---|
number |
Whole number up to 2^48-1 |
shift_amount |
Bits to shift (negative shifts left) |
Examples
Example 1
=BITRSHIFT(A2,B2)
Result: 8. See the worked example table below for more cases.
BITRSHIFT in practice
Where you will use it
- Extracting a field from packed status codes
- Integer division by powers of 2
- Protocol and device data
Worked example
| Number | Shift | Formula | Result |
|---|---|---|---|
| 64 | 3 | =BITRSHIFT(A2,B2) | 8 |
| 255 | 4 | =BITRSHIFT(A3,B3) | 15 |
| 5 | -2 | =BITRSHIFT(A4,B4) | 20 |
Results calculated in Excel.
Mistakes people make
| Mistake | What to do instead |
|---|---|
| Expecting decimals | Bits shifted out are lost (integer result) |
| Negative numbers | #NUM! |
Related functions
📚 Part of the free Excel course: Beginner → Expert · Try it in the Formula Lab or ask the AI Helper.
✨ Ask AI about this article
Stuck on a step? Ask a question and the AI answers using this article.
Free · AI can be wrong