Data Analysis

TRIM Formula in Spanish Google Sheets: ESPACIOS Guide (2026)

Marc SeanMay 25, 20265 min read

That translation is automatic and invisible until it isn't. Paste a formula from an English-locale model into a Spanish-locale sheet and you get #NAME? instantly.

ESPACIOS vs. TRIM: What Changes and What Doesn't

Nothing changes functionally. =ESPACIOS(A2) strips leading and trailing spaces, then collapses any internal runs of multiple spaces down to a single space. Identical behavior to TRIM in any other locale.

What trips people up is what ESPACIOS doesn't strip: non-breaking spaces. The Unicode Consortium's character database defines U+00A0 as "NO-BREAK SPACE" and states explicitly that it "is not treated as whitespace by many text-processing functions." ESPACIOS follows that spec precisely. Feed it a string with CHAR(160) padding and the cell looks clean, but the invisible character stays, silently breaking every BUSCARV, SUMAR.SI.CONJUNTO, and string comparison downstream.

This is not a Spanish-locale quirk. TRIM in English has the same limitation. But it bites harder in Spanish-locale models because Spanish-language ERP and CRM exports - SAP, Oracle, and local accounting systems used across Latin America and Spain - are well-known for embedding CHAR(160) in text fields, particularly entity names, cost center labels, and SKU descriptions. In practice, any data copied from a web browser or pasted from a PDF carries a high risk of U+00A0 contamination, since HTML non-breaking spaces ( ) map directly to CHAR(160).

Where CHAR(160) Breaks Your Model

Here's a concrete example. You're building a P&L consolidation across 12 subsidiary tabs. Revenue by entity feeds from each subsidiary sheet into a Summary tab via SUMAR.SI.CONJUNTO:

=SUMAR.SI.CONJUNTO('P&L_MX'!C:C, 'P&L_MX'!B:B, ">="&Supuestos!$B$3, 'P&L_MX'!A:A, Summary!$A4)

Entity names in column A come from an SAP export. "Grupo Editorial Norte" in the source data looks identical to "Grupo Editorial Norte" in your Assumptions tab - same characters, same visual length. But the export wrapped the name in CHAR(160) padding. The SUMAR.SI.CONJUNTO returns zero. The P&L shows $0 for a $4.2M revenue line. You've just spent 45 minutes "fixing" cross-tab references that were never broken.

According to Google's Sheets function documentation (as of May 2026), ESPACIOS "removes all spaces from a text string except for single spaces between words." The operative word is spaces - Unicode code point U+0020. U+00A0 is a different code point, and ESPACIOS won't touch it.

Microsoft's Excel documentation documents the same behavior for TRIM, noting that the function "does not remove this nonbreaking space character" and recommending SUBSTITUTE as the fix - identical to the approach required in Spanish-locale Sheets.

The Fix: ESPACIOS + SUSTITUIR

Strip CHAR(160) before ESPACIOS touches the string:

=ESPACIOS(SUSTITUIR(A2, CARACTER(160), " "))

SUSTITUIR (SUBSTITUTE in English) replaces every non-breaking space with a regular space. ESPACIOS then collapses everything. Applied across a full entity name column in a consolidation model:

=ARRAYFORMULA(ESPACIOS(SUSTITUIR('P&L_MX'!A2:A500, CARACTER(160), " ")))

Run this as a helper column on each subsidiary tab, then point your SUMAR.SI.CONJUNTO at the helper column instead of the raw SAP export column. Revenue ties. Crisis over.

If your data comes from multiple sources with potentially different encoding issues, stack SUSTITUIR calls:

=ESPACIOS(SUSTITUIR(SUSTITUIR(A2, CARACTER(160), " "), CARACTER(9), " "))

CARACTER(9) is a tab character - another common stowaway in ERP and CSV exports.

Spanish Locale Formulas at a Glance

Google Sheets localizes all function names when the locale is set to a Spanish-speaking country. As of May 2026, this covers more than 400 built-in functions across 50+ supported locales. The ones FP&A analysts hit most often:

EnglishSpanishNotes
TRIMESPACIOSStrips U+0020 whitespace only
SUBSTITUTESUSTITUIRUse with ESPACIOS for CHAR(160)
CHARCARACTERSame code points, same behavior
SUMIFSSUMAR.SI.CONJUNTOFull multi-criteria support
VLOOKUPBUSCARVWorks identically
INDEXINDICEPair with COINCIDIR
MATCHCOINCIDIR
IFERRORSIERROR
IFSI
LEFTIZQUIERDA
RIGHTDERECHA
LENLARGO

One practical implication worth flagging: if you share a model between a Spanish-locale analyst and an English-locale analyst, live formulas translate automatically when opened. But formula text stored as strings - in documentation cells, validation notes, or comments - doesn't translate. Those need manual updates.

Automating the Audit

Tracking down CHAR(160) contamination across a 12-tab consolidation model by hand is tedious. A quick detection formula using LARGO (LEN):

=LARGO(ESPACIOS(A2)) <> LARGO(SUSTITUIR(A2, CARACTER(160), " "))

This returns TRUE for any cell containing a non-breaking space. Wrap in ARRAYFORMULA across your subsidiary tabs to generate a contamination map before you start building cross-tab lookups.

ModelMonkey can run this scan automatically - flag contaminated cells across a range, then write the corrected SUSTITUIR+ESPACIOS formula to a helper column. It works in Spanish-locale sheets natively, so the formulas it writes back use ESPACIOS, SUSTITUIR, and CARACTER rather than their English equivalents.

In summary: =ESPACIOS() is TRIM in Spanish Google Sheets. It handles ordinary whitespace (U+0020) correctly and completely. It does not handle non-breaking spaces (U+00A0 / CHAR(160)), which are common in ERP exports and will silently break SUMAR.SI.CONJUNTO lookups and string comparisons. The fix is =ESPACIOS(SUSTITUIR(A2, CARACTER(160), " ")). Locale translation happens automatically for live formulas - paste English formulas as text into a Spanish-locale sheet and they break with #NAME?. The formulas in this article are already written in their Spanish-locale equivalents.

For more on cleaning data before it reaches your model, see Google Sheets Trim Whitespace: FP&A Guide.

Try ModelMonkey free for 14 days - it works in both Google Sheets and Excel.


Frequently Asked Questions