Formualizer Docs
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

  • number must 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
CellValue
No inputs on Sheet1.
Formula
=
Result
Not evaluated yet.
Expected
24
Use negative shift to move right
Grid
CellValue
No inputs on Sheet1.
Formula
=
Result
Not evaluated yet.
Expected
4

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

arg1

Number · Scalar · coercion NumberLenientText

arg2

Number · Scalar · coercion NumberLenientText

Caps

PURE

Source

On this page