REPLACE in Collabora Office: Edit Known Text Positions and Keep Numeric-Looking Results as Text
Use Collabora REPLACE for fixed-position label repairs, length-changing edits and a clear distinction from substring substitution.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: REPLACE replaces a specified number of characters beginning at a known position. =REPLACE("AB-2026-017";4;4;"2027") is expected to return AB-2027-017. The result is text, even when it looks numeric.
Availability and version history
- Introduced: original Collabora release and launch date are not established by the sources reviewed.
- Availability: documented in Collabora Office 26.04 help, scoped to the desktop-help release.
- Platform scope: online and mobile deployments are not inferred from desktop documentation.
- Checked: October 14, 2026. Direct function documentation and independently modeled text controls; no native Collabora test was performed.
Syntax and character positions
=REPLACE(text;position;length;new_text)
text supplies the original string. position identifies the first character to replace, with the first character numbered 1 in the official example. length counts characters removed from the original, and new_text supplies the complete replacement.
The new text does not have to be the same length as the removed segment. These examples use positive integer positions and lengths inside a known string. The short reference does not establish all out-of-range or negative-input outcomes.
Example 1: replace a fixed-width middle field
Use AB-2026-017 in A2 and enter:
=REPLACE(A2;4;4;"2027")
Expected text: AB-2027-017. Characters 1–3 are AB-, positions 4–7 contain the four-digit year label, and the remaining -017 suffix is preserved. Both source and result have length 11.
This is a label edit, not a date calculation. It does not validate that the four characters represent a real year or update any associated transaction date.
Example 2: replacement width can differ
=REPLACE("AB-17";1;2;"NORTH")
Expected text: NORTH-17. Two characters are removed and five are inserted. The result length is 8, from original length 5 minus 2 plus 5.
Do not set the removal count to the replacement’s length unless that is actually how many source characters should disappear. Position, removal count and insertion length describe different things.
Advanced example: distinguish a position edit from a search edit
For source red-red, =REPLACE("red-red";5;3;"blue") gives expected red-blue. It targets the second three-letter field because its position is known.
SUBSTITUTE instead locates a specified text segment and can select an occurrence. If prefixes can change length, a hard-coded position may target the wrong characters even when the formula returns a plausible result. Preserve the format specification beside the workbook.
Advanced example: mask a display copy without altering the source
For fictional identifier AB-1234-Z, use:
=REPLACE("AB-1234-Z";4;4;"****")
Expected display: AB-****-Z. The four middle digits are replaced, but the original value still exists wherever it was stored. This is a presentation example, not secure deletion, anonymization or permission to disclose a workbook containing the source.
Check another source, CD-9876-Q, using the same known structure. The expected display is CD-****-Q. If a label does not match the fixed-width specification, flag it for review rather than applying the mask uncritically.
Numeric-looking text and conversion
=REPLACE("1200";2;1;"3") gives expected text 1300. Collabora explicitly states that REPLACE’s result is text and directs readers to VALUE when a number is needed for further arithmetic.
Using VALUE on the simple ungrouped text 1300 is a separate conversion decision. Keep identifiers such as 0017 as quoted text when leading zeroes matter. Automatic numeric input conversion can remove those zeroes before REPLACE even receives the source.
The guide does not certify every locale’s numeric parser, date-like string or formatting preservation. The text transformation and any later numeric interpretation should be tested separately in the target file.
References and verification
The dedicated Collabora function page was reviewed. Expected outputs are independently modeled text controls, not captured results from the application. Extended-character, coercion and deployment-specific behavior retain the limits stated above.