Formualizer Docs
ReferenceFunctionsEngineering Functions

BITRSHIFT

BITRSHIFT: Shifts a non-negative integer right or left by a given bit count.

Summary

Positive shift_amount shifts right; negative shift_amount shifts left.

Remarks

  • number must be a whole number in [0, 2^48).
  • Shift values are numerically coerced; large right shifts return 0.
  • Negative shifts that overflow the 48-bit limit return #NUM!.

Examples

Shift right by three bits
Grid
CellValue
No inputs on Sheet1.
Formula
=
Result
Not evaluated yet.
Expected
4
Use negative shift to move left
Grid
CellValue
No inputs on Sheet1.
Formula
=
Result
Not evaluated yet.
Expected
10

FAQ

Why can negative shifts in BITRSHIFT return #NUM!?

A negative shift means left-shift; if that left result exceeds the 48-bit limit, #NUM! is returned.

Runtime metadata

Category

Engineering

Signature

BITRSHIFT(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