TRIM Function in Collabora Office Calc: Formula, Examples & Troubleshooting
Learn the TRIM formula in Collabora Office Calc: remove unwanted ordinary spaces from a text string, with reproducible examples, expected answers and compatibility cautions.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: TRIM removes leading and trailing spaces and leaves one space between words. The original =TRIM(" East team ") control has independently expected text East team. Apply this only when collapsing repeated spaces is an intentional data policy.
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 independent text/numeric controls; no native Collabora test was performed.
Syntax and documented scope
=TRIM(text)
The argument is the text to clean or a reference to the cell containing it. Collabora’s dedicated definition describes removing spaces while preserving a single inter-word space. The controlled examples here use ordinary space characters, English function names and semicolon separators in nested formulas.
That concise definition is not a promise to remove every invisible Unicode character, control code or nonbreaking space. Identify an unexpected character before choosing a replacement rather than assuming a familiar-looking blank has the same representation as an ordinary space.
Original example 1: normalize a team label
=TRIM(" East team ")
Expected text: East team. Two leading spaces, one excess internal space and two trailing spaces are removed. The source has 14 characters and the result has 9.
Original example 2: normalize a different label
=TRIM(" Pad East ")
Expected text: Pad East. The source has 13 characters; the result has 8. The output retains one separator between the two words instead of deleting every space.
These literal controls need no number or date formatting. Preserve the strings exactly when testing; retyping a source without its repeated spaces would create a different input.
Advanced example: construct reproducible spacing in a source cell
In A2 enter a formula that visibly specifies each group of spaces:
=" "&"North"&" "&"Team"&" "
Then use:
=TRIM(A2)
=LEN(A2)-LEN(TRIM(A2))
Expected outputs are North Team and numeric 5. The raw length is 15 and the normalized length is 10. Formula-generated source text avoids relying on whether a paste operation preserved the intended leading and trailing spaces.
LEN measures the character difference, but a shorter result alone does not prove that the right characters were removed. Keep both raw and normalized columns for review.
Advanced example: use a complete three-argument SUBSTITUTE
The earlier abbreviated replacement suggestion omitted the source-text argument. A complete replacement requires the source, the exact text to replace and the replacement text.
For a fully visible control, put |North||Team| in C2:
=TRIM(SUBSTITUTE(C2;"|";" "))
Expected text: North Team. SUBSTITUTE first produces one leading space, two internal spaces and one trailing space; TRIM then normalizes those ordinary spaces. The source length is 13, the intermediate length remains 13, and the final length is 10.
For a character stored separately in E2, the complete form is =TRIM(SUBSTITUTE(C2;E2;" ")). With E2 containing exactly the vertical bar, the same expected result follows. If a real import contains a different separator, first identify it and put that exact character in E2; the vertical-bar example does not certify every Unicode case.
Do not assume CHAR(160) names the same character on every platform. Collabora’s CHAR documentation ties extended codes to the current character table. The controlled normalization above specifies the actual source character instead of making a universal code-table claim.
Advanced example: compare before and after without changing case
Put North Team, ** North Team ** and north team in G2:G4. The normalized outputs are North Team, North Team and north team.
Using EXACT to compare each original cell with its TRIM result gives expected flags TRUE, FALSE, TRUE. TRIM changes spacing under this policy, not the case of letters. The second row needs review because its stored representation changes.
A second application of TRIM to these already-normalized controls leaves them unchanged. That idempotence is a useful small check, but does not establish that the normalized label has the right meaning.
When normalization can lose information
The labels AC 17 and AC 17 become the same ordinary-space result AC 17. If the original spacing distinguishes fields in a fixed-width format, collapsing it would discard information.
Similarly, TRIM does not decide whether two differently spelled labels refer to the same entity. Use it as one explicitly chosen text transformation, rather than a universal deduplication or identifier-validation operation.
Troubleshooting and boundaries
If an apparent blank remains, inspect the source character instead of repeatedly nesting TRIM. CLEAN has a separate nonprinting-character purpose and is not a universal Unicode cleaner either. Neither operation supplies a complete import-validation policy.
The ordinary-space outputs here were independently modeled. An all-whitespace matrix, every nonbreaking-space variant, native numeric coercion and cross-client behavior were not executed. Preserve source values and confirm the intended normalization on a representative sample before filling a large range.
Related program guides
References and verification
The complete older article and its original worked formulas were reviewed. This revision replaces an unrelated mathematical-category citation with the dedicated function page and adds independently modeled controls. No native Collabora execution or complete cross-deployment certification is claimed.