Contact

BITRSHIFT in Calligra Sheets: Extract Fields from Binary Masks

Engineering Intermediate Calligra Sheets

Learn Calligra Sheets BITRSHIFT with bit extraction tables, positive and negative counts, errors, limits, and version evidence.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Availability and version history

  • Introduced: Documented by 26.08.2; original introduction not established.
  • Availability: Supported in Calligra Sheets 26.08.2, based on the function-specific registration.
  • Scope: The official application listing provides Linux installation; other packaged builds are unverified here.
  • Checked: October 14, 2026. Documentation/source check; no new native test in Calligra Sheets 26.08.2.

Quick answer

BITRSHIFT moves the bits of an integer to the right. =BITRSHIFT(13;2) has the expected result 3 because 1101 shifted two places right becomes 11. KDE also documents the reverse behaviour for negative counts: shifting right by -2 is equivalent to shifting left by 2.

Exact syntax and argument order

=BITRSHIFT(number;shift_amount)

number is a required whole-number value or cell reference. shift_amount is a required whole-number count: positive removes the specified number of low-order bit positions, 0 keeps the input, and negative shifts in the opposite direction (left). The Calligra XML defines exactly two integer parameters; no optional argument/default is documented. For small nonnegative integers, right shift by a nonnegative count is equivalent to floor(number / 2^shift_amount), but this analogy is not a blanket specification for negative numbers or oversized bit counts.

Evidence scope, release, locale and testing

Calligra’s English reference uses a semicolon (;) between parameters and ordinary decimal-point examples. Begin cell formulas with =. The notation here follows that documented English-language style. If a translated installation uses a different locale, check its function assistant and local number/separator conventions before copying formulas; this guide has not tested locale variants. The Calligra download page recommends Linux distribution packages or Flatpak and describes Windows as still being worked on. Other platforms and vendor builds were not tested. Function availability in the shipped source is not a promise about every installed package.

Step-by-step example: enter six input rows

Create a blank sheet. Put Number 1 (or Number) in A1, Number 2 (or Shift count) in B1, and Result in C1. Type these plain integers into A2:B7. In C2, type =BITRSHIFT(A2;B2) and fill down through C7. The table displays expected values from independent computation, not screenshots or observed app output.

Row A: Number B: Shift count C: Formula Expected decimal Binary explanation
2 13 2 =BITRSHIFT(A2;B2) 3 1101 shifted right 2 → 11
3 20 1 =BITRSHIFT(A3;B3) 10 10100 shifted right 1 → 1010
4 12 0 =BITRSHIFT(A4;B4) 12 1100 shifted right 0 → 1100
5 3 -2 =BITRSHIFT(A5;B5) 12 11 shifted left 2 → 1100
6 255 4 =BITRSHIFT(A6;B6) 15 11111111 shifted right 4 → 1111
7 1 1 =BITRSHIFT(A7;B7) 0 1 shifted right 1 → 0

What disappears during a right shift

13 is binary 1101. Shifting right by 2 drops the two lowest positions (the final 01), leaving 11 = 3. This is an integer bit operation—not a decimal-point movement. Shifting 1 right once gives 0, because its only set bit is discarded.

If the sign of the shift count is negative, the direction reverses: BITRSHIFT(3;-2) places two zero positions to the right of 11, yielding 1100 = 12. Compare this explicitly with the corresponding positive shift in the BITLSHIFT guide once that companion page is approved and published.

Advanced application: decode a packed status byte

A sample device stores two four-bit fields in an 8-bit value of 171 (1010 1011 in binary). The high four-bit field is 1010 (10) and the low one is 1011 (11).

To extract the high field from cell A2=171, use:

=BITAND(BITRSHIFT(A2;4);15)

Expected result: 10. BITRSHIFT(171;4) first moves 1010 into the low positions; BITAND(...;15) then keeps only the low four positions. To extract the low field, use:

=BITAND(A2;15)

Expected result: 11. As an independent reconstruction check, =BITOR(BITLSHIFT(10;4);11) has expected result 171. These examples intentionally use values within an 8-bit educational range; the application has not been natively tested as a general binary parser.

Errors, assumptions and debugging

  • Using a negative count accidentally: =BITRSHIFT(3;-2) returns an expected 12, because KDE explicitly documents negative counts as an opposite-direction shift.
  • Assuming decimal division: Shifting right by 1 discards the lowest binary bit, so =BITRSHIFT(13;1) has expected result 6; it is not 6.5.
  • Expecting reversibility: Once low bits are discarded, a later left shift does not bring them back. Pack/unpack only within a clear field layout.
  • Whole-number requirements: The handbook and source XML describe both inputs as integers. They do not document exact coercion or error text for all text, blank, fractional or invalid inputs; no native error was observed.
  • Negative operand and very large shift values: The source uses unsigned 64-bit intermediates; do not assume Excel’s negative-input restrictions or platform-independent results. The C++ shift code has no documented guards for counts as large as the machine word and therefore is not a safe basis for unsupported extremes.
  • Mismatch with expected results: Inspect A and B cell values, sign of B, syntax =BITRSHIFT(A2;B2), English semicolon separator, and any shifted/rounded display format. Native behaviour is unverified.

Cross-software compatibility: Excel and LibreOffice Calc

Excel documents BITRSHIFT(number,shift_amount) for a nonnegative integer number bounded by 2^48-1, and an integer shift with absolute value no more than 53; a negative count shifts left. Calligra has matching conceptual direction for small test cases, but its documentation does not guarantee Excel-identical bounds, error codes, negative-number handling or large-shift semantics. No Excel or LibreOffice workbook was executed for this review. See Microsoft’s official BITRSHIFT documentation for its distinct product-specific constraints; never transplant those restrictions into a Calligra claim without evidence.

Official reference and verification

Verification status: Official documentation checked; example outcomes were independently reasoned or arithmetically checked where applicable. Not executed in Calligra Sheets.

  • No genuine Calligra Sheets screenshots are included; this guide does not use mock application images.