Excel
TRIM function in Excel
Removes spaces from text
=TRIM(text)TRIM syntax and parameters
One argument, one required.
- textstringRequired
TRIM examples
Formulas you'll actually reuse.
Strip leading, trailing, and doubled spaces from a pasted name:
=TRIM(A2)Result
"Maria Lopez"Fix a lookup that fails because the key has a trailing space:
=VLOOKUP(TRIM(E2), A2:C200, 3, FALSE)Result
24.99
TRIM in Google Sheets
Same name — your formula ports as-is.
Try TRIM in the playground
Edit the example — nothing to install.
Preloaded with the TRIM formula from Example 1 — change anything and watch it respond.
Loading the editor…
Related functions
More ways Excel gets this done.
- ARRAYTOTEXTReturns an array of text values from any specified rangeTextNo Google Sheets equivalent
- CHARReturns the character specified by the code numberTextGoogle Sheets
- CLEANRemoves all nonprintable characters from textTextGoogle Sheets
- CODEReturns a numeric code for the first character in a text stringTextGoogle Sheets
- CONCATCombines the text from multiple ranges and/or strings, but it doesn't provide the delimiter or IgnoreEmpty arguments.TextGoogle Sheets
- CONCATENATEJoins several text items into one text itemTextGoogle Sheets