Using the Excel BITRSHIFT Function
SummaryThe Excel BITRSHIFT function returns a number that has been shifted right by a specified number of bits.
Use the BITLSHIFT function to return a number shifted to the left by a specified number of bits.
Syntax=BITRSHIFT (number, shift_amount)
Required. The number to be shifted. Can be any integer greater than or equal to 0 (zero).
Required. The amount of bits to shift. Must be a positive integer. If a negative number is entered, number will shift to the left.
Usage NotesBITRSHIFT shifts a number to the right by a specified number of bits. This essentially doubles or halves the number a specific number of times.
How it Works
Shifting a number to the right is similar to removing 0's (zeros) from the right side of the binary representation of the number. For example, a 2-bit shift to the right of the decimal value 40 converts its binary (101000) value to 1010, or 10 in decimal format.
The BITRSHIFT function returns the following errors:
1) #VALUE! if either the number or shift_amount arguments are non-numeric
2) #NUM! if the absolute value of shift_amount is > 53
3) #NUM! if any bit shift results in integer overflow, where the result is larger than 2^48 - 1
4) #NUM! if either argument is outside their constraints