Home › Guides

Excel TRIM Function

Extra spaces break lookups. "Avery " doesn't match "Avery", and that's a common cause of #N/A errors.

Syntax

=TRIM(A2)

TRIM removes spaces at the start and end and squeezes repeated spaces between words down to one.

When TRIM doesn't work

Data copied from websites often has non-breaking spaces (character 160), which TRIM ignores:

=TRIM(SUBSTITUTE(A2,CHAR(160)," "))

Practice

Take the free Excel interview test →