LEFT Function (OpenOffice Calc)
Learn the LEFT function in Apache OpenOffice Calc: Returns the first character or characters of a text.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Availability and version history
- Introduced: Documented by Apache OpenOffice 4.1.16; original introduction not established.
- Availability: Supported in Apache OpenOffice 4.1.16, verified against its function registry. This identifies a supported release, not a final working version.
- Scope: Desktop Calc, using the English function name. Availability in other spreadsheet applications is separate.
- Checked: 2026-10-14 — function reference; versioned support. Documentation/source check; not a new native test. Existing example-specific test claims below retain their stated scope.
LEFT extracts a prefix from a text value. It returns text, even when the extracted characters are digits. Use it for genuinely fixed-width prefixes; use a delimiter search when field lengths vary.
Syntax and arguments
=LEFT(text; count)
=LEFT(text)
text is the source string or reference. Optional count is the number of characters to retain and defaults to 1. Use a nonnegative integer. In the pinned 4.1.16 implementation fractional counts are rounded down and the internal string-length bound is enforced; negative or excessive counts are invalid. The formulas use English function names and Calc’s semicolon argument separator.
Reproducible examples
| Formula | Expected text or number |
|---|---|
=LEFT("Spreadsheet";6) |
"Spread" |
=LEFT("AB-120";2) |
"AB" |
=LEFT("AB-120") |
"A" |
=LEFT("AB-120";0) |
"" |
=LEFT("AB-120";99) |
"AB-120" |
=LEFT("";2) |
"" |
Here "" denotes zero-length text, not a displayed pair of quotation marks. The first example retains the original guide’s formula. Its comparable LibreOffice 25.2 result was not an OpenOffice test; the new examples are expected results derived from the documented operation and independently checked text mappings.
Practical worksheet: extract a fixed department code
Enter HR-001, IT-120 and HR-045 as text in A2:A4. In B2 enter =LEFT(A2;2) and fill down. Expected department codes are HR, IT and HR. This is reliable because the data contract fixes the prefix at two characters. Keep column A so the full record identifier is not lost.
If prefixes instead vary, place SALES-001 in A5. =LEFT(A5;2) gives SA, which is not the department. =LEFT(A5;FIND("-";A5)-1) returns SALES because the first hyphen determines the boundary. A missing hyphen gives a search error and should be investigated rather than silently shortening the record.
Advanced applications
Preserve leading zeros. With text 00127 in A2, =LEFT(A2;3) returns text 001. If A2 is numeric 127 merely displayed as 00127, do not assume LEFT receives the displayed leading zeros. Use =LEFT(TEXT(A2;"00000");3) only when a five-digit numeric format is explicitly the rule.
Remove a suffix. =LEFT(A2;LEN(A2)-4) removes a known four-character suffix. Check LEN(A2)>=4 first; otherwise the derived count is negative. A suffix with variable length needs a different parsing rule.
Errors, edge cases and troubleshooting
A large ordinary count returns the available prefix, not padding. A zero count returns zero-length text, which is not the same as a genuinely empty cell. Spaces count as characters: a leading space becomes the first character unless you deliberately normalize the source.
Do not use LEFT as a character-encoding byte counter or assume that a displayed emoji or combining sequence is one indivisible character. The selected examples use ASCII; the older string implementation does not certify grapheme-safe slicing. Test multilingual identifiers before truncating them.
For a list of records, enter a scalar helper formula in the first result row and fill down. Check the absolute and relative references before copying. Do not assume that a single multi-cell argument automatically produces a modern spill range in OpenOffice Calc.
Related functions
Documentation and verification
See the Apache OpenOffice LEFT reference, 4.1.16 text-function help, and versioned interpreter. The source snapshots were originally retrieved on 2026-10-13 and re-read for this revision. Independent text calculations are not native application or GUI tests. Current support is version-scoped above; introduction and final functioning version remain unestablished.