Engineering functions

BITRSHIFT

Matches all 8,132 recorded answers

Recorded: 8,128 in the answer bank and 4 workbook cells. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
ArabicBITRSHIFT
BulgarianBITRSHIFT
CzechBITRSHIFT
DanishBITRSKIFT
GermanBITRSHIFT
GreekBITRSHIFT
English (Australia)BITRSHIFT
English (United Kingdom)BITRSHIFT
English (United States)BITRSHIFT
SpanishBIT.DESPLDCHA
EstonianBITRSHIFT
FinnishBITTI.SIIRTO.O
FrenchBITDECALD
HebrewBITRSHIFT
CroatianBITRSHIFT
HungarianBIT.JOBB.ELTOL
IndonesianBITRSHIFT
ItalianBITRSHIFT
JapaneseBITRSHIFT
KoreanBITRSHIFT
LithuanianBITRSHIFT
LatvianBITRSHIFT
NorwegianBITRSHIFT
DutchBIT.VERSCHUIF.RECHTS
PolishBIT.PRZESUNIĘCIE.W.PRAWO
Portuguese (Brazil)BITRSHIFT
Portuguese (Portugal)BITDESL.DIR
RomanianBITRSHIFT
RussianБИТ.СДВИГП
SlovakBITRSHIFT
SlovenianBITRSHIFT
Serbian (Latin)BITRSHIFT
SwedishBITHSKIFT
ThaiBITRSHIFT
TurkishBİTSAĞAKAYDIR
UkrainianBITRSHIFT
VietnameseBITRSHIFT
Chinese (Simplified)BITRSHIFT
Chinese (Hong Kong)BITRSHIFT
Chinese (Traditional)BITRSHIFT

Names from Microsoft's support site.

What it does

BITRSHIFT(number, shift_amount)

BITRSHIFT(number, shift_amount) moves an integer’s binary digits right. A negative count reverses the direction. The ordinary right shift corresponds to integer division by a power of two.

Try it

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

=BITRSHIFT(29,2) returns 7. Binary 11101 becomes 111 after dropping the two low bits. =BITRSHIFT(7,-2) returns 28, because a negative count reverses the direction.

Quirks

The number must be an integer in 0..2^48-1; fractional numbers give #NUM!. The count is truncated. Documentation rejects count magnitudes above 53. Recorded build-20430 rules add exceptions: zero bypasses the finite count-range check, and admitted counts of magnitude 49 through 53 return zero in either direction.

How to implement

Validate the number first and require a finite count. Return zero immediately for a zero number. Otherwise truncate the count and reject magnitudes above 53; magnitudes 49 through 53 return zero. Convert the function and count sign to a left/right direction. Before a left shift of k, check number <= (2^48-1)>>k; reject overflow with #NUM!. A right shift discards the low bits. Return the resulting integer as a worksheet number. These shortcuts are recorded compatibility behaviour, and should not be replaced by a host language’s masked shift-count semantics.

Rust code

Show the CalcFunc source of this function

Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.

BITRSHIFT · 3 lines · calc-func/src/catalogue/engineering.rs on GitHub
24 bitrshift "BITRSHIFT" (2, 2) [V "number", V "shift_amount"] |s, a, sv| {
    bits(s, a, k::bitrshift_fn::bitrshift_kernel)
}
bitrshift_kernel · 3 lines · calc-func/src/ported/bitrshift_fn.rs on GitHub
pub fn bitrshift_kernel(number: f64, shift: f64) -> Result<f64, WorksheetErrorCode> {
    bit_shift_kernel(number, shift, false)
}

Kernels shared with other functions

Argument and result plumbing

  • num catalogue/kit
  • out catalogue/kit

No implementation has been published with a Handbook test suite for this function.

Version differences

The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.

Excel 16.0 buildPlatform and CPUCaptured inputs
20430Windows, 64-bit, CPU not recorded8,128

The record contains no same-input comparison between these environments. Reading different inputs on different builds does not establish either a version change or cross-build agreement.

Recorded environments and comparison details.

Excel 16.0 build 20430

Windows, 64-bit, CPU not recorded

8,128 captured inputs are indexed for this environment. Capture dates: 2026-09-29 to 2026-09-29. This is a reading count, not a comparison with another build.

Alternatives

BITLSHIFT changes the default direction. BITAND extracts a bit field after shifting.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents