← All functions

TRIM

Quirk found

Category: Text · Last tested 2026-08-06

Real, executed compatibility results for the TRIM function across Microsoft Excel, Google Sheets, and LibreOffice Calc — verified by actually running it. Syntax and links to each vendor’s official documentation are below.

Support matrix

EngineDocumentedLive-testedVerdict
Excel Yes Not yet n/a
Google Sheets Yes Not yet n/a
LibreOffice Calc Yes Yes (25.8.7.3, 2026-08-06) Quirk found

LibreOffice version history

We executed the same test cases under each LibreOffice release to show exactly when TRIM’s support changed — not documentation claims, real results.

LibreOffice versionVerdictTested
24.2.0.3 Quirk found 2026-07-19
24.8.7.2 Quirk found 2026-07-19
25.2.0.3 Quirk found 2026-07-24
25.8.7.3 Quirk found 2026-08-06

Why isn't TRIM working in LibreOffice?

TRIM exists in LibreOffice 25.8.7.3, but it is not a drop-in match for Excel — our executed tests found real behavioral differences (detailed in the test results on this page). If a formula that works in Excel or Google Sheets misbehaves in LibreOffice, compare your usage against the failing cases above before assuming your data is wrong.

Discovered quirks

Executed test cases

LibreOffice Calc 25.8.7.3 (tested 2026-08-06)

FormulaDescriptionResultExpectedVerdict
=TRIM(" Hello World ") Leading/trailing spaces are stripped and multiple interior spaces collapse to a single space Hello World Hello World Matched
=TRIM(CHAR(9)&"Hello") TRIM only removes the regular ASCII space character (decimal 32); it does NOT remove other whitespace such as a tab (CHAR(9)), so the leading tab survives untouched Hello Hello
Microsoft docs: "the TRIM function was designed to trim the 7-bit ASCII space character (value 32) from text" -- it does not generalize to other whitespace. Source: https://support.microsoft.com/en-us/office/trim-function-410388fa-c5df-49c6-b16c-9e5630b479f9
Matched
=TRIM(CHAR(160)&"Hello"&CHAR(160)) TRIM does not remove the non-breaking space character (CHAR(160), HTML  ) even though it renders as whitespace -- a real, documented, and easy-to-miss cross-engine divergence point since data pasted from web pages is full of CHAR(160) �Hello�  Hello 
Microsoft docs state explicitly: "by itself, the TRIM function does not remove the nonbreaking space character (which has a decimal value of 160 and is commonly used in web pages as the HTML entity )." Source: https://support.microsoft.com/en-us/office/trim-function-410388fa-c5df-49c6-b16c-9e5630b479f9
Mismatch
=TRIM("No Extra Spaces") A string with only single spaces between words passes through unchanged No Extra Spaces No Extra Spaces Matched

Docs & syntax

Related how-to recipes

Compared against other functions