BITRSHIFT Function in Excel returns the right shift of supplied integers by specified number of bits.
Note: BITRSHIFT Function was only introduced from Excel 2013 onwards
Bit right shift Explained
Bit right shift operator shifts all bits towards right by certain number of specified bits. Let’s see an example of right shift of 212
212 = 11010100 (In binary)
Right shift by 2 bit gives
212>>2 = 00110101
Right shift by 7 bits gives
212>>7 = 00000001
Right shift by 0 gives
212>>0 =11010100
Syntax of BITRSHIFT Function in Excel (BIT RIGHT SHIFT OPERATION IN EXCEL):
BITRSHIFT (number, shift_amount)
Where
- number – The Number that you want to perform right shift operation on
- shift_amount – An integer that specifies the number of bits to be shifted right
Example of BITRSHIFT Function in Excel (BIT RIGHT SHIFT OPERATION IN EXCEL):
FORMULA:
RESULT:
NOTE: #NUM! – Error occurs if
- The supplied number arguments is a non-integer;
- The supplied number arguments is negative or is greater than (2^48)-1.