LENB Function (Gnumeric)
Count UTF-8 bytes with LENB in Gnumeric. Compare characters and byte lengths, inspect combining accents, and reproduce numeric and blank-input cases.
Verification status: Cached October 14, 2026 evidence; no new application run on October 15. 16 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: =LENB("Helsinki") produced 8 in Gnumeric 1.12.57.
Availability and version history
- Introduced: First introduction is unestablished; the exact function is present in 1.12.57 source.
- 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 LENB returns
LENB returns the number of bytes in Gnumeric’s string representation. For the valid Unicode strings used here, that is their UTF-8 byte length. It is not the number of visible glyphs, the character count from LEN, or the size of a saved spreadsheet file. Versioned function help.
Syntax and arguments
=LENB(text)
- text: One required string. Numeric and logical inputs are converted to text in the selected cases:
125uses three bytes andTRUEuses four.
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 |
|---|---|---|
=LENB("Helsinki") |
8 |
8 |
=LENB("Lévy") |
5 |
5 |
=LENB("A中B") |
5 |
5 |
=LENB("A😀B") |
6 |
6 |
=LENB("é") |
2 |
2 |
=LENB("é") |
3 |
3 |
=LENB("") |
0 |
0 |
=LENB("ABC") |
9 |
9 |
Practical worksheet
Put Lévy in A2. =LEN(A2) counts four Unicode characters, while =LENB(A2) counts five UTF-8 bytes: one for L, two for é, one for v and one for y. Use the byte result only if the receiving field actually measures UTF-8 bytes. A limit expressed in characters or another encoding needs a different check.
Advanced interpretation and checks
The saved =LENB("Lévy")-LEN("Lévy") result is 1. This difference is the extra UTF-8 storage beyond one byte per code point, not the number of accented letters in general.
Precomposed é is U+00E9 and uses two bytes. The visually similar decomposed sequence é is U+0065 followed by U+0301 and uses three bytes. LENB does not normalize them first. Likewise, A😀B uses six bytes even though it has three code points. Display width cannot substitute for a byte count.
Boundaries and troubleshooting
F2 contains text Lévy; F3 is numeric 125; F4 is text 125; F5 is genuinely blank. F6 was authored as empty text, but the native saved XML omits it like a blank cell, so its zero result does not prove preservation of an empty-string type. Literal "" is tested separately.
The source calculates a C-string byte length. These examples use valid UTF-8; the malformed ASC output cases are not a recommendation to use LENB as a text-validity checker. Other spreadsheet products may define their B-functions using different encoding rules.
| Formula | Gnumeric 1.12.57 CSV result |
|---|---|
=LENB(125) |
3 |
=LENB(TRUE()) |
4 |
=LENB(F2) |
5 |
=LENB(F3) |
3 |
=LENB(F4) |
3 |
=LENB(F5) |
0 |
=LENB(F6) |
0 |
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 LENB 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.