Applies ToExcel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel 2024 Excel 2024 for Mac Excel 2021 Excel 2021 for Mac Excel 2019 Excel 2016

This article describes the formula syntax and usage of the BITLSHIFT function in Microsoft Excel.

Description

Returns a number shifted left by the specified number of bits.

Syntax

BITLSHIFT(number, shift_amount)

The BITLSHIFT function syntax has the following arguments.

  • Number    Required. Number must be an integer greater than or equal to 0.

  • Shift_amount    Required. Shift_amount must be an integer.

Remarks

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

  • If either argument is outside their constraints, BITLSHIFT returns the #NUM! error value.

  • If Number is greater than (2^48)-1, BITLSHIFT returns the #NUM! error value.

  • If the absolute value of Shift_amount is greater than 53, BITLSHIFT returns the #NUM! error value.

  • If either argument is a non-numeric value, BITLSHIFT returns the #VALUE! error value.

  • 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.

Example

Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.

Formula

Description

Result

How it works

=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.

Top of Page

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.