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
numbermust 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
| Cell | Value | |
|---|---|---|
| No inputs on Sheet1. | ||
Formula
=
Result
Not evaluated yet.
Expected
4
Use negative shift to move left
Grid
| Cell | Value | |
|---|---|---|
| No inputs on Sheet1. | ||
Formula
=
Result
Not evaluated yet.
Expected
10
Related functions
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
arg1Number · Scalar · coercion NumberLenientText
arg2Number · Scalar · coercion NumberLenientText
Caps
PURE
Source