Site icon Best Excel Tutorial

How to Use BITRSHIFT Function in Excel: Bitwise Right Shift Operations

Need to divide binary numbers by shifting bits to the right in Excel? The BITRSHIFT function lets you move the bits of a number to the right by a specified number of positions, which effectively divides the number by powers of 2. This guide shows you how, step-by-step.

1. Understand BITRSHIFT Function Logic

By default, BITRSHIFT shifts all bits in a number to the right and discards bits that fall off the right edge. So before you use BITRSHIFT, you must:

2. Step-by-Step: Use BITRSHIFT for Bit Shifting

✅ Step 1: Enter Your Numbers in Excel Cells

  1. Open your Excel spreadsheet
  2. In cell A1, enter the number you want to shift (for example: 20)
  3. In cell B1, enter how many positions to shift right (for example: 2)
  4. Leave cell C1 empty for the BITRSHIFT result

✅ Step 2: Write the BITRSHIFT Formula

  1. Click on cell C1 where you want the result
  2. Type the formula: =BITRSHIFT(A1,B1)
  3. Press Enter
  4. Excel shifts the bits and displays the result (in this case: 5)

Now the formula is complete. BITRSHIFT moved all bits two positions to the right, which divided 20 by 4 (2^2) to get 5.

3. Tips for Better BITRSHIFT Operations

4. Bonus: Advanced BITRSHIFT for Calculations and Scaling

Want even more control? You can use BITRSHIFT to efficiently divide numbers or scale values down. Here’s an example:


Example 1: Simple right shift division
Number: 24 (binary: 11000)
Shift by: 3 positions
Formula: =BITRSHIFT(A1, 3)
Result: 3 (24 ÷ 2^3 = 24 ÷ 8 = 3)

Example 2: Scale down a value by dividing by power of 2
Original value: 1600
Scale factor needed: 16 (which is 2^4)
Formula: =BITRSHIFT(1600, 4)
Result: 100

Example 3: Progressive scaling with variable shift
Base amount: 320
Divide by: 5 (shift right by 5 = divide by 32)
Formula: =BITRSHIFT(Base, Divisions)
Result: 10 (320 ÷ 32)

Example 4: Combine right shift with other operations
Starting value: 33
Shift right by: 2
Then subtract remainder: 1
Formula: =BITRSHIFT(A1, B1) - C1
Result: 7 (33 ÷ 4 - 1)

Example 5: Integer division using BITRSHIFT
Dividend: 100
Divisor: 8 (use shift right by 3 instead)
Formula: =BITRSHIFT(100, 3)
Result: 12 (integer division: 100 ÷ 8 = 12 remainder 4)

This approach lets you efficiently divide by powers of 2 or scale values down without using the division operator.

Troubleshooting BITRSHIFT Functions

Sometimes users say that BITRSHIFT returns unexpected results or errors.

  1. Check if your number is really a positive integer between 0 and 2^53-1.
  2. Make sure your shift amount is a valid positive integer (usually 0 to 53).
  3. Review the binary representation—each position shifted right divides by 2, so shifting by 3 should divide by 8.

Another common issue is that BITRSHIFT returns #NUM! error or decimal values when you expected whole numbers.

Learning how to use BITRSHIFT in Excel is a great way to efficiently divide by powers of 2 or scale values down quickly. You don’t have to use traditional division—let BITRSHIFT shift the bits and focus on your calculations.

Try it out and master bitwise operations in Excel today!

Exit mobile version