Contact

BITLSHIFT Function in ONLYOFFICE Spreadsheet Editor: Syntax and Practical Examples

Engineering Intermediate ONLYOFFICE Spreadsheet Editor

A left shift moves the binary representation toward higher place values by appending zeros to the right. Within ordinary nonnegative integer arithmetic and absent overflow, shifting left by *k* positions multiplies by `2^k`. Learn official syntax, reproducible worksheet examples, advanced applications, and verification limits.

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

Availability and version history

  • Introduced: The original introduction version and date are not established by the official sources checked.
  • Availability: Documented in the current ONLYOFFICE Spreadsheet Editor help; no final working-version endpoint is established.
  • Scope: Docs and Desktop Editors release separately. This unversioned help does not establish availability in every older build, mobile client or deployment.
  • Checked: October 14, 2026, against the official function reference. Documentation check; not a new native test.

Quick answer

Shift a nonnegative integer left by a specified nonnegative number of bit positions. The exact current English ONLYOFFICE formula signature is =BITLSHIFT(number, shift_amount). The function belongs to the Engineering category of ONLYOFFICE Spreadsheet Editor. Both parameters are required; there is no optional parameter or documented default. This syntax and the rule below come from the official ONLYOFFICE BITLSHIFT reference (checked 2026-10-13 UTC).

Verification: Worksheet and advanced results were independently calculated using exact integer arithmetic. Native ONLYOFFICE Docs or Desktop execution, localized input and historical-version compatibility were not tested.

What the function does, and when to use it

A left shift moves the binary representation toward higher place values by appending zeros to the right. Within ordinary nonnegative integer arithmetic and absent overflow, shifting left by k positions multiplies by 2^k.

Official bit rule: For a nonnegative shift count, append that many binary zeros on the right. The vendor notes establish that operational description. They do not provide a complete specification of all width, overflow, coercion, locale, or legacy-version behaviors.

Left shifting is multiplication by powers of two for the chosen nonnegative examples. In binary, 1100₂ is 12 decimal and 1100000₂ is 96 decimal: appending three zeros gives 12 × 8 = 96.

Shift counts are measured in bits, not decimal places. BITLSHIFT appends binary zero positions; BITRSHIFT removes low-order positions. Neither operation should be described as shifting characters in a decimal text string.

Understand the binary bits without typing binary literals

A bit is 0 or 1. The places in a binary numeral are valued at 1, 2, 4, 8, 16, 32, and so on from the rightmost place. As a result, 1100â‚‚ is 12 decimal, whereas 1010â‚‚ is 10 decimal. Subscript â‚‚ in the article is a mathematical label; do not paste it into a formula argument. Input 12 as the number twelve; do not enter the text string "1100" expecting ONLYOFFICE to parse it as binary.

For a shift, the second numeric argument is an integer count, rather than another bit mask. A shift of zero leaves the number unchanged mathematically; a shift of three moves by three binary places.

Exact syntax, argument order, and types

=BITLSHIFT(number, shift_amount)
Position Argument Required? Official ONLYOFFICE type/rule Default
1 number Required number — required integer greater than or equal to zero. No default; must be supplied.
2 shift_amount Required shift_amount — required integer specifying the number of bit positions. No default; must be supplied.

No argument is optional. The first argument goes first even if you change the order of source columns. The official reference supplies neither an optional-width argument nor an optional mode selector for BITLSHIFT. Do not add brackets to the formula: they are a documentation convention used for some other functions, but not part of this function’s documented signature.

Type distinction: Column B is a whole, nonnegative decimal integer; column C is the integer shift count. All sample shifts are nonnegative to avoid claiming how the installed ONLYOFFICE edition handles negative shift counts. The official reference does not define these edge cases.

The official formula-insertion guide describes using the Home or Formula tab and the search in Insert Function. The individual function article supplies the formula signature and notes used here.

Step-by-step worksheet: 20 reproducible test rows

Use a clean worksheet so no earlier sample values or formulas change these cell references:

  1. In A1 type Scenario, in B1 type Number, in C1 type Shift count, in D1 type BITLSHIFT formula result, and in E1 type Independent expectation. Keep inputs in B and C as numeric cells, not binary strings.
  2. Populate A2:C21 with the input columns in the table below. Each B and C cell must contain the decimal integer displayed in the table. Column C is the shift count for the SHIFT functions; otherwise it is the second mask.
  3. In D2, type =BITLSHIFT(B2,C2) and press Enter. Use the fill handle to copy the same relative formula down through D21. For the comparisons, put the corresponding expected numbers from the table into E2:E21.
  4. Optional manual review column F: put =D2=E2 in F2 and copy down; a TRUE result would show equality in your own installed edition. This step has not been executed here, so don’t interpret it as a passed native test.
  5. When a result differs, record the app and version, Docs vs Desktop, locale, input cell type, exact formula text, and any displayed error. Compare the vendor argument rules first. Save your workbook if you decide to run the separate native-validation phase.

Inputs and independently expected outputs

Row Scenario B (decimal) C (shift count) Expected D B in binary Expected D in binary
2 Zero stays zero 0 0 0 0 0
3 Zero shifted by seven 0 7 0 0 0
4 No shift 1 0 1 1 1
5 One to two 1 1 2 1 10
6 One to 32 1 5 32 1 100000
7 Three by two 3 2 12 11 1100
8 Odd value one step 5 1 10 101 1010
9 Seven by three 7 3 56 111 111000
10 Power of two two steps 8 2 32 1000 100000
11 Twelve by three 12 3 96 1100 1100000
12 Odd 13 by two 13 2 52 1101 110100
13 Nibble by four 15 4 240 1111 11110000
14 Forty-two one step 42 1 84 101010 1010100
15 Forty-two three steps 42 3 336 101010 101010000
16 Eighty-five two steps 85 2 340 1010101 101010100
17 One bit shifted by six 128 6 8192 10000000 10000000000000
18 Byte by four 255 4 4080 11111111 111111110000
19 Ten bits by seven 1023 7 130944 1111111111 11111111110000000
20 Twelve ones by eight 4095 8 1048320 111111111111 11111111111100000000
21 16-bit pattern one step 65535 1 131070 1111111111111111 11111111111111110

How to read the table: For every row, the independent calculation converted each B numeric input into binary, applied the documented bit position operation to nonnegative integral inputs, and converted the resulting binary integer back to decimal. The results are not a screenshot or native editor output.

Paste-ready formula checks

Formula typed into a spare cell Independent expected decimal value Result bits
=BITLSHIFT(0,0) 0 0
=BITLSHIFT(0,7) 0 0
=BITLSHIFT(1,0) 1 1
=BITLSHIFT(1,1) 2 10
=BITLSHIFT(1,5) 32 100000
=BITLSHIFT(3,2) 12 1100
=BITLSHIFT(5,1) 10 1010
=BITLSHIFT(7,3) 56 111000
=BITLSHIFT(8,2) 32 100000
=BITLSHIFT(12,3) 96 1100000

For a quick human cross-check, the example =BITLSHIFT(12,3) should produce 96 in the independent model, but this does not establish how untested versions calculate or format the result.

Advanced, practical applications

1. Build a flag in position five

An unsigned mask of decimal 1 can be shifted five positions to represent bit 5, or decimal 32.

  • Enter =BITLSHIFT(1,5). Independent expected result: 32, because 1 is 1â‚‚, the shift count is 5, and the output is 100000â‚‚.
  • Enter =BITLSHIFT(1,8). Independent expected result: 256, because 1 is 1â‚‚, the shift count is 8, and the output is 100000000â‚‚.
  • Enter =BITLSHIFT(1,3). Independent expected result: 8, because 1 is 1â‚‚, the shift count is 3, and the output is 1000â‚‚.

Bit positions here are zero-indexed for the mathematical explanation; downstream specifications may label bits differently.

2. Pack a byte field into a higher position

Move the decimal field 15 four bit positions to the left.

  • Enter =BITLSHIFT(15,4). Independent expected result: 240, because 15 is 1111â‚‚, the shift count is 4, and the output is 11110000â‚‚.
  • Enter =BITLSHIFT(5,8). Independent expected result: 1280, because 5 is 101â‚‚, the shift count is 8, and the output is 10100000000â‚‚.
  • Enter =BITLSHIFT(255,4). Independent expected result: 4080, because 255 is 11111111â‚‚, the shift count is 4, and the output is 111111110000â‚‚.

Left shifting is a mathematical operation. Before mixing fields, validate the receiving format width and allowed ranges.

3. Double and scale by powers of two

Shift decimal 12 by three bits to obtain 96.

  • Enter =BITLSHIFT(12,3). Independent expected result: 96, because 12 is 1100â‚‚, the shift count is 3, and the output is 1100000â‚‚.
  • Enter =BITLSHIFT(42,1). Independent expected result: 84, because 42 is 101010â‚‚, the shift count is 1, and the output is 1010100â‚‚.
  • Enter =BITLSHIFT(3,2). Independent expected result: 12, because 3 is 11â‚‚, the shift count is 2, and the output is 1100â‚‚.

Do not confuse multiplying by a power of two with shifting decimal digits, rounding, or text padding.

Compare BITLSHIFT with other operations

A negative shift_amount is not part of the positive-count examples and the checked vendor article does not document its interpretation. Do not infer an opposite-direction rule from other spreadsheet software.

A few identities help detect mistakes before putting a bit mask in production. The following are mathematical rules on nonnegative integers, not a vendor-issued runtime promise about unlimited precision:

  • BITAND(a,b), BITOR(a,b), and BITXOR(a,b) are different ways to compare two masks: shared, any, and differing bits respectively.
  • a OR b = (a XOR b) + (a AND b) mathematically. This helps distinguish mask merging from regular decimal addition, which treats overlapping bits differently.
  • For nonnegative integer n and nonnegative count k, shifting left is n × 2^k, while shifting right is the whole-number quotient of n ÷ 2^k; this relationship explains the examples but says nothing about the editor’s maximum supported width.
  • If you combine mask operations, keep the original decimal inputs in separate source columns. Do not overwrite raw device statuses, access codes or source measurements with computed flags; a conversion can hide which source contributed a bit.

Important note about leading zeros and signed values

A plain numeric cell stores a number, not a fixed-length binary string. Leading zeros may be meaningful in a hardware protocol but are not represented by these arithmetic examples. A negative signed integer uses representation conventions that are not specified in the checked BITLSHIFT reference. If your task needs a signed two’s-complement width, choose and document the protocol width separately and test the actual ONLYOFFICE version before claiming parity with another system.

Error conditions, documentation gaps and troubleshooting

The official BITLSHIFT help page specifies the allowed argument category and the bit rule, but it does not list a complete table of runtime error codes. The following problematic inputs are review cases, not errors observed in an editor. Never present #NUM!, #VALUE!, #NAME?, or a truncation rule as a verified result unless separately established from a relevant official source or native test.

Formula / diagnostic case What the official rule or reference establishes What still needs checking
=BITLSHIFT(-1,2) Source rule: first argument must be a nonnegative integer. Vendor-stated domain violation; exact resulting error token untested.
=BITLSHIFT(1,1.5) Source rule: shift amount is an integer. The source does not say whether values are truncated, rejected or coerced.
=BITLSHIFT(8,-1) Negative shift direction not described by the official text. Do not claim opposite-direction behavior without native execution.
=BITLSHIFT(1,100) Large shift and maximum output width not specified by the cited page. Potential precision/range uncertainty; do not assign an error code.
=BITLSHIFT("text",2) Numeric input is required. Exact coercion and error display untested.

What to check if your result surprises you:

  1. Confirm BITLSHIFT is selected, rather than an adjacent name such as XOR, AND or OR with different semantics. The vendor lists this function under Engineering.
  2. Verify numeric input values in decimal, including negative signs, decimal fractions, empty cells, and pasted strings. The clean worked table uses only integral nonnegative numeric values.
  3. Verify argument order and exactly two comma-separated arguments in the English reference. The current formula UI instructions illustrate function insertion; locale-specific separators and labels must be checked in the target editor.
  4. For a shift, confirm that C2 is an integer count of binary positions, not a request for the number of output characters. For a mask operation, C2 is a second decimal mask, not a shift count.
  5. Prefer smaller sample integers while checking a version-specific maximum width. Exact overflow rules, boundaries and floating-point precision need native validation rather than assumptions borrowed from another spreadsheet.
  6. Preserve the formula, input types and installed build number in any issue report. No vendor error screenshots were captured; any formula returning a displayed error in a reviewer’s editor must be reported with that editor version before recording an exact error token.

Compatibility checks for your installation

  • Recreate each of the 20 safe rows in a specifically identified ONLYOFFICE Docs web version and record actual cell values.
  • Repeat selected boundary cases in a specifically identified Desktop Editors build, noting operating system and file format.
  • Check invalid negatives, fractions, blank/text cells and large values, and capture actual error tokens only after reproducible execution.
  • Check decimal separators, argument separators and localized function naming, using an actual non-English regional configuration.
  • Test save/reopen and export compatibility; an XLSX round-trip in another program would not alone establish that ONLYOFFICE executed the formula identically.

ONLYOFFICE platform, release, regional-language and compatibility notes

The guide is vendor-specific: ONLYOFFICE’s English Insert Functions catalogue lists this as an engineering function with its current unversioned online help. The same title does not establish a release-specific compatibility matrix or version of the calculation engine.

Web/Docs versus Desktop Editors: The official ONLYOFFICE Docs changelog lists Docs 10.0.0 released October 10, 2026. The separate Desktop Editors changelog lists Desktop Editors 9.4.0 released May 19, 2026 in its release history. The official Desktop GitHub release history also lists 10.0.0 released 13 October 2026. These pages are two different products’ release histories. Neither checked page identifies the first Docs or Desktop release supporting BITLSHIFT, and neither demonstrates a native execution of our examples. Treat old editions and shared XLSX compatibility as not verified, not automatically equivalent.

Formula syntax/locales: The examples use the English-language function spelling, an = prefix, the comma between two arguments shown in the official reference, and a period only in English explanatory numbers where needed. ONLYOFFICE offers additional Spreadsheet Editor advanced settings; do not assume this English formula can be pasted unchanged in every language or region. The function’s region-specific label and formula-argument separator were not tested in a running editor.

Validation boundaries: The vendor documents syntax and the basic operation; our mathematical verification confirms examples independently. Neither source type establishes installed behavior for fractions, negative counts, large bit widths, signed integers or cross-edition coercion. Those claims remain explicitly unverified.

The following links lead to official ONLYOFFICE references:

Sources and verification limits

  • Primary claim-level source: ONLYOFFICE BITLSHIFT reference — title, purpose, exact two-argument signature, argument conditions and bit-operation notes; inspected 2026-10-13 UTC.
  • Official UI context: Inserting functions and Advanced Settings; checked 2026-10-13 UTC.
  • Official release context: Docs changelog and Desktop changelog; checked 2026-10-13 UTC, with desktop/web differences explicitly unresolved.
  • Independent numerical verification: the examples were generated and cross-checked using Python exact integers and the algebraic relationships described above. a & b for BITAND, a | b for BITOR, a ^ b for BITXOR, a << k for left shift, and a >> k for right shift are used only as independent mathematical models on the safe nonnegative integral samples.
  • Missing verification: No native ONLYOFFICE execution (Docs or Desktop), no captured error messages, no screenshot, no localized editor run, no historical-version compatibility testing.

Last official source check: 2026-10-13 UTC. Guide research status: official-reference checked; independently calculated; native editor execution not performed.