
Shift bits to the left by a chosen number of positions. Useful for scaling by powers of two, building masks, and moving values into higher bit positions.
BITLSHIFT moves the bits of a number to the left by a chosen number of positions. In practical terms, shifting left increases the value by powers of two as long as the result stays within Excel's supported range.
This is useful when you want to place a value into a higher bit position, build a mask, or scale a number in a bitwise way instead of plain arithmetic. It is one of the simplest tools for working with bit fields and packed values.
Its main role is structural rather than descriptive. BITLSHIFT helps place values into higher bit positions, which is useful when a workbook builds masks or packed numeric fields from smaller parts. The decimal result may grow quickly, but the real purpose is that the underlying bit pattern moves into the correct slot.
Moves bits into higher positions.
Returns the decimal value of the shifted bit pattern.
=BITLSHIFT(number, shift_amount)
number is the starting value. shift_amount is how many positions to move the bits.
A positive shift moves the bits to the left. A negative shift moves them the other way and behaves like BITRSHIFT. The answer is returned in decimal, even though the operation is happening on the binary form of the number.
number must be a whole number that is 0 or larger. shift_amount also has to be a whole number. Small shift values are the most practical because very large shifts can push the result outside the supported range and return #NUM!.
BITLSHIFT is about moving bits, not just multiplying numbers in the usual way:
| Function | What it does | Typical use | Result |
|---|---|---|---|
BITLSHIFT |
Moves bits left | Scale by powers of two or build masks | Number |
BITRSHIFT |
Moves bits right | Reduce or extract higher bits | Number |
* |
Multiplies numbers normally | Regular arithmetic | Number |
DEC2BIN |
Shows a value in binary text | Inspect the result visually | Binary text |
The most direct way to think about BITLSHIFT is that every left shift multiplies by 2. A shift of 1 doubles the value, a shift of 2 multiplies by 4, and so on. That makes it useful when you want a fast, bit-based way to scale a value.
It is also a good way to move a value into a higher field. For example, shifting 255 left by 8 puts that pattern into a higher byte position. That is handy when you are building masks or packed values from smaller pieces.
Microsoft also notes that BITLSHIFT works with non-negative integers up to 2^48 - 1, and if the absolute shift amount is greater than 53 Excel returns #NUM!. A negative shift amount acts like shifting right. Source: Microsoft Support, BITLSHIFT function.
This example shows the simplest left shift rule. Moving every bit one place to the left multiplies the number by 2.
That is why 5 becomes 10 here. It helps beginners connect the bit movement with the normal decimal result they see in the cell.
=BITLSHIFT(5, 1) // Returns 10
Shift decimal 5 left by 1 bit (x2).
This example is useful when a value needs to be moved into a higher byte or field. The bits are not changing identity. They are just being shifted into a new position.
That is a common pattern in packed values and masks. You start with a smaller number and place it higher inside a larger binary structure.
=BITLSHIFT(255, 8) // Returns 65280
Shift bit-value 255 to the high-byte pos (8 bits).
This example starts with the value 1 and moves it left until it reaches the bit position you want. That gives you the decimal value of that single bit.
It is a simple way to build masks such as 2, 4, 8, 16, and so on without memorizing each one separately.
=BITLSHIFT(1, 4) // Returns 16
Shift 1 by 4 bits to create a mask for bit-5 (16).
This example extends the same pattern. A shift of 2 means the value is multiplied by 2^2, which is 4.
That helps show that left shifts scale very quickly. The more positions you move, the bigger the multiplier becomes.
=BITLSHIFT(7, 2) // Returns 28
Shift decimal 7 left by 2 bits (x4).
BITLSHIFT is useful when a value needs to be moved into higher bit positions. In this lesson, that meant seeing how a left shift preserves the pattern but relocates it, which is why the result grows in the same way as multiplying by powers of two.
This makes BITLSHIFT handy for building masks, packing values, or preparing one piece of data to sit in the correct bit slot inside a larger number. Once you think of it as "move the pattern left, then read the new decimal result," the function becomes much easier to reason about.
#NUM!.Tell your friends about this post