Skip to content
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.

  1. Strip leading, trailing, and doubled spaces from a pasted name:

    =TRIM(A2)

    Result"Maria Lopez"

  2. Fix a lookup that fails because the key has a trailing space:

    =VLOOKUP(TRIM(E2), A2:C200, 3, FALSE)

    Result24.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…