LEFTB Function (Gnumeric)
Use LEFTB in Gnumeric to keep a UTF-8 byte-limited prefix. Learn whole-character truncation, optional byte counts, empty results and safe examples.
Verification status: Cached October 14, 2026 evidence; no new application run on October 15. 17 selected expressions were recalculated with Gnumeric 1.12.57 ssconvert. Formula identities and raw CSV fields were checked; Gnumeric 1.12.62 was source-checked only; GUI display and native output types were not verified. How formula examples are checked
Quick answer: =LEFTB("Lévy",3) produced “Lé” in Gnumeric 1.12.57.
Availability and version history
- Introduced: Introduced in Gnumeric 1.9.10 release notes.
- Supported in: Registered in Gnumeric 1.12.62; no retirement is established.
- Last functioning version: Selected calculations are verified in 1.12.57. The newest functioning release is unverified; source registration in 1.12.62 does not establish newer runtime results.
- Scope: Desktop Gnumeric with its String Functions plugin. English comma-separated formulas are shown.
- Checked: October 14, 2026. Tables use 1.12.57 ssconvert under C.UTF-8; 1.12.62 was source-inspected only.
What LEFTB returns
LEFTB returns a prefix containing complete UTF-8 characters, with at most the requested number of bytes. If the byte budget ends inside a character, that character is omitted rather than split. It does not pad the result to the requested length. Versioned function help.
Syntax and arguments
=LEFTB(text[,num_bytes])
- text: Required source text.
- num_bytes: Optional maximum byte count; the default is 1. Nonnegative fractional counts are truncated in the tested cases. Negative counts give
#VALUE!.
Brackets indicate optional arguments; do not type them. Current worksheet implementation.
Reproducible examples
The native column records recalculated CSV field content. Quotes delimit readable text; "" means an empty field expected to be text from the callback. They do not certify the exported cell type. The independent column checks the stated character mapping, UTF-8 byte operation or decimal conversion.
| Formula | Gnumeric 1.12.57 CSV result | Independent reference |
|---|---|---|
=LEFTB("Lévy",3) |
"Lé" |
"Lé" |
=LEFTB("Lévy",2) |
"L" |
"L" |
=LEFTB("Lévy",1) |
"L" |
"L" |
=LEFTB("Lévy",4) |
"Lév" |
"Lév" |
=LEFTB("Aä¸B",4) |
"Aä¸" |
"Aä¸" |
=LEFTB("Aä¸B",3) |
"A" |
"A" |
=LEFTB("A😀B",5) |
"A😀" |
"A😀" |
=LEFTB("A😀B",4) |
"A" |
"A" |
Practical worksheet
For a UTF-8 field capped at three bytes, =LEFTB("Lévy",3) returns Lé. Reducing the budget to two bytes returns only L, because the two-byte é would cross the limit. Put the original in A2 and the budget in B2, then use =LEFTB(A2,B2). Keep the unshortened value when truncation could create duplicate identifiers.
Advanced interpretation and checks
The saved =LEFTB("Lévy",3)&RIGHTB("Lévy",2) reconstructs Lévy, because the split falls exactly between complete characters. This is not true for every pair of byte budgets: a split through the two-byte é would omit it from one or both pieces.
For A😀B, the emoji occupies bytes 2–5. A four-byte prefix budget returns only A; a five-byte budget returns A😀. This illustrates why a result may be substantially shorter than the requested maximum.
Boundaries and troubleshooting
The default one-byte budget returns empty text for é, rather than one accented character. Use LEFT when the requirement is a character count. Zero bytes returns empty text; an oversized budget returns the full source. The selected 2.9-byte case behaves as two bytes.
F2 is Lévy and F5 is genuinely blank. These source and native checks concern complete UTF-8 code points; they do not promise preservation of a whole grapheme cluster made from several code points, such as a base letter followed by a combining accent.
| Formula | Gnumeric 1.12.57 CSV result |
|---|---|
=LEFTB("é") |
"" |
=LEFTB("Lévy",0) |
"" |
=LEFTB("Lévy",2.9) |
"L" |
=LEFTB("Lévy",99) |
"Lévy" |
=LEFTB("",1) |
"" |
=LEFTB("Lévy",-1) |
#VALUE! |
=LEFTB(F2,3) |
"Lé" |
=LEFTB(F5,1) |
"" |
Official evidence and checking scope
The source snapshots and native results below were retained from October 14, 2026. The recovered guide was checked against those saved records on October 15; neither the application nor a newer release was executed again.
The complete LEFTB callback is byte-identical between the two inspected releases. Both stale and uncached SUM controls recalculated correctly. Saved native XML retains the function identities. No GUI result display, other locale, native output-type certification or newer-release execution is claimed.