✍️ Excel text examples

TRIM and CLEAN Examples in Excel

Learn practical trim and clean examples in excel for cleaning text, extracting values and building spreadsheet labels.

Updated 2026-06-125 practical examplesCopy-ready

💡 Ideas for You

Learning resources for Excel formulas, spreadsheets and reporting.

4 useful links

Some links in this section may be affiliate links. Choose only what is useful for your own work.

What it does

TRIM removes extra spaces and CLEAN removes many non-printing characters.

Syntax or pattern

=TRIM(text) / =CLEAN(text)

5 practical examples

1

Remove extra spaces

Clean a name imported with double spaces.

=TRIM(A2)

TRIM keeps single spaces between words.

2

Clean imported text

Remove non-printing characters.

=CLEAN(A2)

Useful after copying from systems or PDFs.

3

Use both together

Clean messy imported text.

=TRIM(CLEAN(A2))

A strong first cleanup step.

4

Fix lookup values

Clean a lookup value before matching.

=XLOOKUP(TRIM(A2),Products[Code],Products[Name])

Hidden spaces often break lookups.

5

Clean full column with table reference

Apply cleanup to a table column.

=TRIM(CLEAN([@Name]))

Works well in helper columns.

Common mistakes to avoid

  • Not handling missing delimiters.
  • Forgetting that some text functions return text, not numbers.
  • Using fixed positions when the text layout is not consistent.

Related Excel examples

FAQ

Can text formulas work with Excel Tables?

Yes. Table references can make text-cleaning formulas easier to understand.