BITRSHIFT Function

Shifts a number's bits to the right (divides by a power of 2, dropping the remainder).

Category

Engineering

Available in

Excel 2013+, Microsoft 365

Returns

A whole number

Want to practice BITRSHIFT in a real spreadsheet? Open a blank sheet in our Practice Sandbox and try it with live data, with the AI Excel tutor beside you. No Excel needed — just a free account.Try it free in the Sandbox

Overview

BITRSHIFT moves every bit a number of places to the right; bits that fall off the end are lost. Each place halves the value and rounds down, so shifting 13 by 2 gives 3.

A negative shift amount moves the bits left instead.

Syntax

=BITRSHIFT(number, shift_amount) Explain

Arguments

ArgumentRequired?What it does
numberYesA whole number from 0 to 2^48 − 1.
shift_amountYesHow many places to shift, up to 53 either way. Negative shifts left.

Examples

Example 1 — How the bits combine

Each row combines the two numbers bit by bit; the answer is shown as an ordinary decimal number.

C2fx=BITRSHIFT(A2,B2)
ABC
1NumberShiftResult
21323
31641
4100150
53-212
=BITRSHIFT(A2,B2) Explain

Example 2 — Is switch 2 on?

Shift the switch you want into the last place, then keep just that bit.

C2fx=BITAND(BITRSHIFT(B2,2),1)
ABC
1PersonCodeApprove on?
2Ana131
3Ben30
4Cy71
=BITAND(BITRSHIFT(B2,2),1) Explain

Common mistakes

  • #NUM! Both numbers must be whole numbers from 0 up to 2^48 − 1 (281,474,976,710,655). Negative numbers, decimals and bigger values return #NUM!.

Notes

  • Permission flags are a classic use: give each option a power of two (View = 1, Edit = 2, Approve = 4, Admin = 8) and store a person's access as one number — 13 means View + Approve + Admin.
  • Related functions: BITLSHIFT, BITAND, QUOTIENT.
Kyle Stott

Author

Kyle Stott

Certified Microsoft Excel Expert

Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.