ReferenceFunctionsEngineering Functions
BITLSHIFT
BITLSHIFT: Shifts a non-negative integer left or right by a given bit count.
Summary
Positive shift_amount shifts left; negative shift_amount shifts right.
Remarks
numbermust be a whole number in[0, 2^48).- Shift values are numerically coerced; large positive shifts can return
#NUM!. - Left-shift results must remain below
2^48, or the function returns#NUM!.
Examples
Shift left by two bits
Grid
| Cell | Value | |
|---|---|---|
| No inputs on Sheet1. | ||
Formula
=
Result
Not evaluated yet.
Expected
24
Use negative shift to move right
Grid
| Cell | Value | |
|---|---|---|
| No inputs on Sheet1. | ||
Formula
=
Result
Not evaluated yet.
Expected
4
Related functions
FAQ
What does a negative shift_amount do in BITLSHIFT?
Negative shifts are interpreted as right shifts, while positive shifts move bits left.
Runtime metadata
Category
Engineering
Signature
BITLSHIFT(arg1: Number, arg2: Number)Arity
min 2, max 2
Arguments
arg1Number · Scalar · coercion NumberLenientText
arg2Number · Scalar · coercion NumberLenientText
Caps
PURE
Source