Excel BITLSHIFT Function

Summary

The Excel BITLSHIFT function returns a number that has been shifted left by a specified number of bits.

Use the BITRSHIFT function to return a number shifted to the right by a specified number of bits.

Syntax

=BITLSHIFT (number, shift_amount)

Syntax Breakdown

Number
Required. The number to be shifted. Can be any integer greater than or equal to 0 (zero).

Shift Amount
Required. The amount of bits to shift. Must be a positive integer. If a negative number is entered, number will shift to the right.

Usage Notes

BITLSHIFT shifts a number to the left 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 left is similar to adding 0's (zeros) to the right of the binary representation of the number. For example, a 2-bit shift to the left of the decimal value 10 converts its binary (1010) value to 101000, or 40 in decimal format.

BITLSHIFT Errors
The BITLSHIFT 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