Contact

REPLACEB Function (Gnumeric)

Text Beginner Gnumeric Gnumeric 1.9.11

Replace UTF-8 byte spans with REPLACEB in Gnumeric. Learn whole-character boundaries, insertions, and the changed overflow rules between inspected versions.

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

Version difference: Gnumeric 1.12.57 rejects removal spans extending beyond the string. The inspected 1.12.62 callback instead clamps the start and length. The native boundary results below apply to 1.12.57.

Quick answer: =REPLACEB("Lévy",2,2,"*") produced “L*vy” in Gnumeric 1.12.57.

Availability and version history

  • Introduced: Introduced in Gnumeric 1.9.11 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 REPLACEB returns

REPLACEB removes a byte span from the original UTF-8 text and inserts a replacement string. Both ends of the removed span must align with character boundaries. The byte count measures removed text, not the replacement’s length. Versioned function help.

Syntax and arguments

=REPLACEB(text,start_byte,num_bytes,replacement)
  • text: Required original string.
  • start_byte: Required one-based byte position.
  • num_bytes: Required nonnegative bytes to remove; zero inserts without deleting.
  • replacement: Required inserted text, which may have a different byte length.

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
=REPLACEB("Lévy",2,2,"*") "L*vy" "L*vy"
=REPLACEB("Lévy",2,3,"*") "L*y" "L*y"
=REPLACEB("Lévy",2,4,"*") "L*" "L*"
=REPLACEB("Lévy",4,0,"-") "Lé-vy" "Lé-vy"
=REPLACEB("A中B",2,3,"X") "AXB" "AXB"
=REPLACEB("A😀B",2,4,"X") "AXB" "AXB"
=REPLACEB("abc",2,1,"中") "a中c" "a中c"
=REPLACEB("abc",4,0,"!") "abc!" "abc!"

Practical worksheet

=REPLACEB("A😀B",2,4,"X") gives AXB: the four-byte emoji is replaced by one byte. In contrast, replacing one byte at position 2 in Lévy would cut é in half and returns #VALUE!. Use a byte-aware search and the entire matched text’s LENB when deriving the span.

Advanced interpretation and checks

The saved =LENB(REPLACEB("A😀B",2,4,"X")) is 3. The byte-length accounting is original 6 minus removed 4 plus replacement 1. For =REPLACEB("abc",2,1,"中"), the result a中c has five bytes even though both original and result have three characters.

A zero-length span supports insertion: =REPLACEB("abc",4,0,"!") appends !. The position immediately after the end is valid for this insertion in the tested version.

Boundaries and troubleshooting

In 1.12.57, =REPLACEB("abc",2,99,"X") and a start of 9 both give #VALUE!. In the 1.12.62 source, the first is expected to become aX and the latter to append X, because the start and removal length are clamped. Those newer outcomes were not executed.

Neither version’s inspected code permits a negative length or position below 1. Cutting inside a UTF-8 character remains invalid. The selected fractional arguments are truncated; F2 contains Lévy. These byte positions should not be copied unchanged to an application using a different B-function encoding convention.

Formula Gnumeric 1.12.57 CSV result
=REPLACEB("Lévy",2,1,"*") #VALUE!
=REPLACEB("Lévy",3,2,"*") #VALUE!
=REPLACEB("abc",2,99,"X") #VALUE!
=REPLACEB("abc",9,1,"X") #VALUE!
=REPLACEB("",1,0,"X") "X"
=REPLACEB("abc",0,1,"X") #VALUE!
=REPLACEB("abc",1,-1,"X") #VALUE!
=REPLACEB("Lévy",2.9,2.9,"*") "L*vy"
=REPLACEB(F2,2,2,"*") "L*vy"

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 REPLACEB callback changes bounds checking, clamping and string construction. The guide distinguishes the tested older errors from newer source-derived outcomes. 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.