Related Function:

The BITLSHIFT function returns a number shifted left by the specified number of bits.

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

Syntax

=BITLSHIFT(number,shift_amount)

Arguments

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

Note: Shifting a number left is equivalent to adding zeros (0) to the right of the binary representation of the number, e.g. a 2-bit shift to the left on the decimal value 4 converts its binary value (100) to 10000, or 16 in decimal.

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

Examples

  A B C D
1 Formula Description Result Notes
2 =BITLSHIFT(4,2) Shifts bits left for the number by adding zeros (0) to the right of the number represented in binary. The number returned is represented in decimal 16 4 is represented as 100 in binary. Adding two 0 digits to the right results in 10000, which is 16 in decimal
3 =BITLSHIFT(5,2)   20 5 is represented as 101 in binary. Adding two 0 digits to the right results in 10100, which is 20 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 function result evaluates to a value greater than 2^48

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