Contact

LEFT in Calligra Sheets: Extract the Beginning of Product Codes

Text Beginner Calligra Sheets

Use Calligra Sheets LEFT to extract text prefixes, understand the optional length, and avoid incorrect SKU parsing.

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 and purpose

LEFT returns characters from the beginning of a text value. For example, =LEFT("BK-1042";2) has the expected result BK. It is useful for extracting a fixed-length product-family prefix before using codes for a review table or an inventory filter. It does not know where a product-category delimiter is; you supply the number of characters.

Verified syntax, arguments, and defaults

=LEFT(text;length)
=LEFT(text)

text (required): a string literal in quotation marks or a cell containing source text. length (optional): the number of characters to take from the left, defined by the KDE XML as an integer. If omitted, the pinned 26.08.2 implementation assigns 1. If longer than the string, it returns the whole string; a negative length returns #VALUE! in the pinned source. A requested 0 characters produces an empty string under the source’s QString::left(0) operation. Values that are not whole numbers, mixed types, or encoded Unicode require native testing for precise coercion and error display; do not assume Excel’s coercion rules.

In the English KDE reference the argument separator is a semicolon (;) and a cell formula starts with =. The decimal and argument separators may vary with locale: this sample is for the documented English syntax, not every translated UI. No locale was executed in this run.

Reproducible worksheet: fixed-length prefixes

On a new sheet, type Code in A1 and Prefix length in B1. Enter the six values below in A2:B7. Place Prefix in C1. In C2, enter =LEFT(A2;B2) and copy it down to C7. Columns A and B are literal test inputs; C is the formula and its independently computed expected output.

Row A — Code (text) B — Length C — Formula Expected C
2 BK-1042 2 =LEFT(A2;B2) BK
3 DVD-241 3 =LEFT(A3;B3) DVD
4 TOY-003 3 =LEFT(A4;B4) TOY
5 TCG-028 3 =LEFT(A5;B5) TCG
6 COM-801 3 =LEFT(A6;B6) COM
7 AB 4 =LEFT(A7;B7) AB

Expected, not observed: C7 returns all of AB because four exceeds the two-character input. All results were checked independently on ASCII strings; Calligra was not launched. For text identifiers with leading zeros, enter the value as text (for example TOY-003) rather than treating it as a number.

Advanced application: remove a fixed-width suffix

If every identifier ends with exactly a hyphen and four digits (-1042, -2026), a dynamic prefix formula is:

=LEFT(A2;LEN(A2)-5)

With A2 = BK-1042, LEN(A2) is 7, so the requested prefix length is 2 and the expected result is BK. This is only reliable when the suffix really is five characters long. It is not a general “split at hyphen” formula: DVD-241 ends with four characters, and LEN(A3)-5 would produce DV rather than DVD. Validate the data format first; short codes can also make the calculated length negative and trigger an error.

A second classification example uses the existing IF function:

=IF(LEFT(A2;2)="BK";"Books";"Review")

With A2 = BK-1042, expected Books; with A2 = DVD-241, expected Review. This is an independent logical evaluation, not a Calligra native test. It checks two-character prefixes, so do not use it to validate all possible code families.

Problems, limits, and troubleshooting

  • #VALUE! for a negative count: the pinned implementation explicitly returns that error for length < 0. Check calculations involving LEN before passing them into LEFT.
  • Only one character returned: omitting length defaults to 1, as demonstrated in the official LEFT("KSpread") example.
  • An unexpected prefix: LEFT counts from the beginning and does not detect punctuation, slashes or delimiters. Check whether the intended prefix widths vary.
  • Missing zeros or changed codes: identifiers that are truly numbers can lose leading zeros when entered as numeric cells. Store SKU-like values as text.
  • Display or locale mismatch: verify the leading =, quotation marks for literal text, cell references, separator shown in your function assistant, and cell formatting before classifying the result as wrong.
  • Unicode and LEFTB caution: The English handbook describes LEFTB in byte positions, but the 26.08.2 registration declares LEFTB as an alternate name for the same func_left implementation, using QString::left. These two pieces of official evidence do not justify promises of separate byte-handling behaviour. Do not treat LEFTB as a distinct tutorial or presume Excel-equivalent Unicode behavior without a native non-ASCII test.

Excel and other spreadsheet compatibility

Microsoft Excel also uses LEFT(text,[num_chars]) with a default count of 1, although its English examples use commas rather than Calligra’s documented semicolons. The ordinary ASCII examples above have the same expected characters. Excel’s published LEFTB compatibility notes and Unicode rules are Excel-specific; there was no workbook import/export test in Calligra, Excel, LibreOffice, or Google Sheets. Verify character boundaries and argument separators when transferring multilingual formulas.

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.