Related Function:

The BITRSHIFT function returns a supplied integer, shifted right by a specified number of bits.

  • This function was introduced in Excel 2013 and so is not available in earlier versions.

Syntax

=BITRSHIFT(number,shift_amount)

Arguments

Argument Description
number The number that you want the operation to be performed upon. Must be a positive integer
shift_amount An integer value, specifying the number of bits by which the supplied number is to be shifted

Note: Shifting a number right is equivalent to removing digits from the rightmost side of the binary representation of the number, e.g. a 2-bit shift to the right on the decimal value 13 converts its binary value (1101) to 11, or 3 in decimal.

  • A negative number used as the shift_amount argument shifts the number of bits to the left
  • A negative number used as the shift_amount argument returns the same result as a positive shift_amount argument for the BITLSHIFT function

Examples

  A B C D
1 Formula Description Result Notes
2 =BITRSHIFT(13,2) Shifts bits right for the number by stripping the specified rightmost digits of the number represented in binary. The number returned is represented in decimal 3 13 is represented as 1101 in binary. Stripping the rightmost two digits results in 11, which is 3 in decimal
3 =BITRSHIFT(20,2)   5 20 is represented as 10100. Sipping the rightmost two digits results in 101, which is 5 in decimal

Common Function Error(s)

Problem What went wrong
#VALUE! Occurs if one or both of the supplied arguments is non-numeric
#NUM! Occurs if either:

  the supplied number argument is a non-integer
  the supplied number argument is negative or is greater than (2^48)-1

The Excel Bitwise functions convert the supplied integer value(s) to binary form and then perform an operation on the individual bits. 

The result is then converted back to an integer value before being returned.

Further information on Bitwise operations is provided on the Wikipedia Bitwise Operation Page