MIDB Function (Gnumeric)
Extract UTF-8 substrings with MIDB in Gnumeric. See its three required arguments, byte-boundary errors, partial-end trimming and reproducible examples.
Verification status: Cached October 14, 2026 evidence; no new application run on October 15. 18 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
Syntax detail: Supply all three arguments. The inspected registration requires text, start and length, although the embedded help incorrectly describes defaults for the latter two.
Quick answer: =MIDB("Lévy",2,2) produced “é” 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 MIDB returns
MIDB starts at a one-based byte position and returns complete UTF-8 characters within a byte budget. The starting position must identify the first byte of a character inside the string. A final partial character is omitted. Versioned function help.
Syntax and arguments
=MIDB(text,start_byte,num_bytes)
- text: Required source string.
- start_byte: Required one-based starting byte.
- num_bytes: Required nonnegative maximum byte length. The selected positive fractional positions and lengths are truncated.
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 |
|---|---|---|
=MIDB("Lévy",2,2) |
"é" |
"é" |
=MIDB("Lévy",2,1) |
"" |
"" |
=MIDB("Lévy",4,2) |
"vy" |
"vy" |
=MIDB("Lévy",1,3) |
"Lé" |
"Lé" |
=MIDB("Aä¸B",2,3) |
"ä¸" |
"ä¸" |
=MIDB("Aä¸B",2,2) |
"" |
"" |
=MIDB("A😀B",2,4) |
"😀" |
"😀" |
=MIDB("A😀B",2,3) |
"" |
"" |
Practical worksheet
In Lévy, L occupies byte 1, é occupies bytes 2–3, v byte 4 and y byte 5. Therefore =MIDB("Lévy",2,2) returns é, but a length of 1 returns empty text. Starting at byte 3 is invalid because it is the continuation byte of é. Use MID when your starting position is a character index.
Advanced interpretation and checks
The saved expression =MIDB("Lévy",2,2)&MIDB("Lévy",4,2) produces évy. Each segment begins on a valid boundary. For an extraction based on a search, use a byte-position search and a byte length consistently; mixing FIND with MIDB can put the start inside a multibyte character.
The Aä¸B and emoji examples show that a valid start alone is insufficient to include the next character: the length must cover all three or four bytes respectively.
Boundaries and troubleshooting
Unlike a common expectation for MID, a start at or beyond the byte immediately after the string gives #VALUE!, even with length zero. The empty-source =MIDB("",1,0) case also errors. At a valid internal start, zero length returns empty text; a sufficiently large length returns the remaining suffix.
Position zero and negative length are invalid. F2 contains Lévy. The three-required-argument rule comes from the registration and callback, not from an omitted-argument native probe.
| Formula | Gnumeric 1.12.57 CSV result |
|---|---|
=MIDB("Lévy",3,2) |
#VALUE! |
=MIDB("Lévy",6,0) |
#VALUE! |
=MIDB("",1,0) |
#VALUE! |
=MIDB("Lévy",2,0) |
"" |
=MIDB("Lévy",2,99) |
"évy" |
=MIDB("Lévy",0,1) |
#VALUE! |
=MIDB("Lévy",1,-1) |
#VALUE! |
=MIDB("Lévy",2.9,2.9) |
"é" |
=MIDB(F2,2,2) |
"é" |
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 MIDB callback differs only in whitespace between the inspected releases; its argument registration requires three arguments in both. 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.