BITLSHIFT Function

Shifts a number's bits to the left (multiplies by a power of 2).

Category

Engineering

Available in

Excel 2013+, Microsoft 365

Returns

A whole number

Want to practice BITLSHIFT in a real spreadsheet? Open a blank sheet in our Practice Sandbox and try it with live data, with the AI Excel tutor beside you. No Excel needed — just a free account.Try it free in the Sandbox

Overview

BITLSHIFT moves every bit a number of places to the left, filling with zeros. Each place doubles the value, so shifting by 3 multiplies by 8.

A negative shift amount moves the bits right instead.

Syntax

=BITLSHIFT(number, shift_amount) Explain

Arguments

ArgumentRequired?What it does
numberYesA whole number from 0 to 2^48 − 1.
shift_amountYesHow many places to shift, up to 53 either way. Negative shifts right.

Examples

Example 1 — How the bits combine

Each row combines the two numbers bit by bit; the answer is shown as an ordinary decimal number.

C2fx=BITLSHIFT(A2,B2)
ABC
1NumberShiftResult
24216
3138
413126
54-21
=BITLSHIFT(A2,B2) Explain

Example 2 — Make the flag values

Switch number n is worth 2^n. BITLSHIFT(1, n) builds the list.

C2fx=BITLSHIFT(1,B2)
ABC
1SwitchnValue
2View01
3Edit12
4Approve24
5Admin38
=BITLSHIFT(1,B2) Explain

Common mistakes

  • #NUM! Both numbers must be whole numbers from 0 up to 2^48 − 1 (281,474,976,710,655). Negative numbers, decimals and bigger values return #NUM!.
  • #NUM! on a large result. The shifted answer must stay below 2^48. BITLSHIFT(2^47, 1) returns #NUM!.

Notes

  • Permission flags are a classic use: give each option a power of two (View = 1, Edit = 2, Approve = 4, Admin = 8) and store a person's access as one number — 13 means View + Approve + Admin.
  • Related functions: BITRSHIFT, BITAND, POWER.
Kyle Stott

Author

Kyle Stott

Certified Microsoft Excel Expert

Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.