BITLSHIFT in Excel: Shift Bits and Pack Small Fields
Shift nonnegative integer bits left in Excel, handle negative shift counts and pack two four-bit fields with independently checked examples.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: BITLSHIFT(number,shift_amount) moves the bits of a nonnegative integer left for a positive shift, appending binary zeros. A negative shift moves right. The result is a decimal number, not a binary text string.
Availability and version history
- Introduced: the Microsoft function catalogue marks this identity as an Excel 2013 addition. An exact first build or preview date is not established.
- Availability: official help lists Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016.
- Checked: October 14, 2026; official BITLSHIFT reference. Documentation and independent models; no native Excel execution or wider platform certification.
Syntax, direction and limits
=BITLSHIFT(number,shift_amount)
Both arguments are required integers. number must be nonnegative and no greater than 2^48−1, or 281474976710655. The absolute shift amount must not exceed 53. Microsoft documents #NUM! when these constraints are violated and #VALUE! for nonnumeric arguments.
A positive shift by k positions corresponds to multiplying the integer by 2^k in the small, valid examples here. Negative counts invoke the documented right-shift behavior of BITRSHIFT, which can discard information.
The dedicated reference states the input ceiling but does not separately specify every output-overflow boundary. This guide does not promise that arbitrarily wide results are retained or infer an overflow error from another function. Its examples stay far inside the numeric limits.
Example 1: follow a left shift step by step
Enter 3 in A2 and shift counts 0, 1, 2, 3 and 4 in B2:B6. In C2 enter and fill through C6:
=BITLSHIFT($A$2,B2)
| Shift | Expected decimal result | Binary explanation |
|---|---|---|
| 0 | 3 | 11 |
| 1 | 6 | 110 |
| 2 | 12 | 1100 |
| 3 | 24 | 11000 |
| 4 | 48 | 110000 |
In D2 use =$A$2*2^B2 and fill down. The values 3, 6, 12, 24 and 48 independently agree with the shift model. The zero shift is a no-change control.
For a different source, =BITLSHIFT(5,3) returns 40: binary 101 becomes 101000. The shift amount is a number of bit positions, not a number of decimal digits; multiplying 5 by 1000 would answer a different question.
Example 2: a negative shift removes low bits
Enter 13 in F2. These formulas illustrate the direction change:
| Formula | Expected result |
|---|---|
=BITLSHIFT(F2,-1) |
6 |
=BITLSHIFT(F2,-2) |
3 |
=BITLSHIFT(F2,-3) |
1 |
=BITLSHIFT(F2,-4) |
0 |
For −2, binary 1101 loses its two rightmost digits and becomes 11, or 3. It is not the ordinary division result 3.25. =BITRSHIFT(F2,2) is the documented equivalent.
Shifting that result left again gives =BITLSHIFT(3,2), or 12, not the original 13. The discarded low bits cannot be recovered without storing them separately. By contrast, shifting 12 right twice and left twice returns 12 because the removed bits were both zero.
Advanced example: pack two four-bit quantities
A small record format allocates four bits each to a high field and a low field. Restrict each input to integers from 0 through 15. Enter this table in H1:I5:
| H, high field | I, low field |
|---|---|
| 3 | 9 |
| 0 | 15 |
| 15 | 0 |
| 15 | 15 |
In J2 enter and fill through J5:
=BITOR(BITLSHIFT(H2,4),I2)
The packed values are 57, 15, 240 and 255. For the first record, shifting 3 left four places gives 48 and the low field supplies 9, producing binary 00111001.
Unpack with =BITRSHIFT(J2,4) in K2 and =BITAND(J2,15) in L2, then fill down. The original pairs 3/9, 0/15, 15/0 and 15/15 are recovered exactly. BITOR combines the fields; BITAND extracts the low mask.
The width constraint is essential. If high=3 and low=25, the same combination returns 57, indistinguishable from low=9. The extra bit overlaps the high field. A correct shift cannot compensate for an invalid record schema.
Errors and safe use
Fractional shift counts are outside the documented integer constraint; do not assume they are truncated. Negative input numbers are also outside scope, even though negative shift amounts are permitted. Counts 54 and −54 exceed the documented absolute limit.
Keep bit positions and decimal display separate. DEC2BIN can illustrate the small positive results above, but its input range is narrower than BITLSHIFT’s. Native overflow, imported text coercion and extreme shifts remain untested.
References and verification
Expected outputs are independently calculated examples or documented rules, not captured native Excel results. Formulas use English function names and comma argument separators. Locale, rendering and boundary restrictions are stated where relevant.