Syntax
| Parameter | Description |
|---|---|
| number | Parameter of the BITRSHIFT function. |
| shift_amount | Parameter of the BITRSHIFT function. |
Examples
Shift right by 2
=BITRSHIFT(16, 2)
Integer division by 8
=BITRSHIFT(100, 3)
Extract upper nibble from a byte
=BITRSHIFT(0xAB, 4)
Common Errors
The number is negative, or the shift amount is negative or exceeds 53.
An argument is non-numeric.
Tips
BITRSHIFT(n, k) is equivalent to INT(n / 2^k). The fractional part is discarded, not rounded.
Combine BITRSHIFT and BITAND to extract specific bit ranges: BITAND(BITRSHIFT(value, startBit), 2^numBits-1) isolates any bit field.
Unlike left shift which fills with zeros, right shift permanently discards the rightmost bits. BITRSHIFT(BITLSHIFT(5, 2), 2) returns 4, not 5, if any bits were lost.
Try BITRSHIFT in Viztab
Import your data and use BITRSHIFT with 370+ other formulas. No signup required.
Open Viztab