Contact

BITLSHIFT in Collabora Office: Pack Positive Integer Fields and Track Lost Bits

Math Intermediate Collabora Office Calc

Shift Collabora Calc integer bits left, use negative counts for right shifts and independently verify a two-field record without assumed overflow limits.

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

Quick answer: BITLSHIFT moves an integer’s bit pattern left by the supplied count. For a small positive input, =BITLSHIFT(5;3) has expected result 40. A negative count requests the corresponding right shift.

Availability and version history

  • Introduced: the original Collabora release and launch date are not established by the reviewed sources.
  • Availability: documented in Collabora Office 26.04 desktop help.
  • Platform scope: online and mobile deployment support is not inferred from the desktop documentation.
  • Checked: October 14, 2026. Function-specific documentation and independent controls; no native Collabora execution.

Syntax and the documented scope

=BITLSHIFT(Number; Shift)

Number is documented as a positive integer below 2^48, or 281474976710656. Shift is the number of bit positions to move. A negative Shift is explicitly equivalent to BITRSHIFT(Number;-Shift).

The Collabora section does not state an absolute shift-count limit, fractional-count behavior, zero-input acceptance, output-overflow policy or exact native errors. No Excel or Google bound is substituted here. Every worked number is positive and every count is a small integer.

For these small values, shifting left k positions multiplies the number by 2^k. The operation appends binary zeros, not decimal zeros. Multiplying by 10^k would describe a different positional system.

Example 1: follow a left shift one position at a time

Enter 5 in A2 and counts 1, 2, 3 and 4 in B2:B5. In C2 enter and fill down:

=BITLSHIFT($A$2;B2)
Shift count Expected number Binary explanation
1 10 1010
2 20 10100
3 40 101000
4 80 1010000

In D2 use =$A$2*2^B2 and fill down. The independently expected products are the same 10, 20, 40 and 80. The original 5 has binary form 101.

The official source supplies a separate control: =BITLSHIFT(6;1) returns 12. Its binary 0110 becomes 1100 after one left shift.

Example 2: negative counts discard low bits

Enter 29 in F2. Its binary form is 11101.

Formula Independently expected result
=BITLSHIFT(F2;-1) 14
=BITLSHIFT(F2;-2) 7
=BITLSHIFT(F2;-3) 3
=BITLSHIFT(F2;-4) 1
=BITLSHIFT(F2;-5) 0

The count −2 removes the final two bits and leaves 111, or 7. Ordinary division gives 29/4=7.25, which retains information the shift discards.

Shifting 7 left two positions returns 28, not 29. The removed remainder is 1. The zero in the final row is a modeled output from positive input 29; it does not certify zero as a new input.

Advanced example: pack two four-bit fields

Define two positive fields, each an integer from 1 to 15. Enter this table in H1:I5:

H, high field I, low field
1 1
5 12
14 3
15 15

In J2 enter and fill through J5:

=BITOR(BITLSHIFT(H2;4);I2)

Expected packed values are 17, 92, 227 and 255. The first field is shifted into positions with weight 16 and higher; the second occupies the four lowest bits.

Use =BITRSHIFT(J2;4) and =BITAND(J2;15) in adjacent columns. Expected recovered pairs are 1/1, 5/12, 14/3 and 15/15. BITOR combines the positions and BITAND selects the low field.

Advanced check: an invalid field can overlap silently

Set high=5 and low=28. The low value violates the one-to-fifteen design because it needs five bits.

=BITOR(BITLSHIFT(5;4);28)

The independent bitwise result is 92, the same packed value as valid high=5, low=12. The extra low-field bit overlaps a bit already present in the shifted high field. The conversion cannot infer that this was an invalid record.

Validate each field before packing. A mathematically correct bit result is not proof that the input followed its schema.

Limits and useful comparisons

BITRSHIFT is the separately documented opposite direction. A right shift followed by a left shift is reversible only when no nonzero low bits were discarded, or when you retained and restored the remainder.

DEC2BIN can display the small packed values, for example 92 at width 8 gives 01011100. Its own signed input interval does not define the bit-operation range.

Fractional counts, extreme shifts, zero arguments, coercion and exact overflow/error behavior remain unverified. The source’s positive Number bound and the small explicit count controls are the certified documentation scope.

References and verification

Complete function-specific documentation reviewed. Outputs are independently calculated positional, equality or arithmetic models, not captured native application results. Formulas use English names and semicolon separators; optional-argument brackets describe syntax and are not typed into a working formula.