✍️ 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

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.

💡 Useful resources

Here are some ideas for you

Optional resources that may help if you are learning formulas, building reports, or working in spreadsheets often.

  • 📘
    Excel formula books

    Practice formulas with structured examples you can keep beside your desk.

    See ideas
  • ⌨️
    Excel shortcut guides

    Build speed with keyboard shortcuts for selection, formatting and navigation.

    See ideas
  • 🔢
    Numeric keypads

    Helpful if you enter many numbers on a laptop or compact keyboard.

    See ideas
  • 🖥️
    External monitors

    Useful for viewing large worksheets, formulas and reference tables side by side.

    See ideas
  • 📒
    Desk notebooks

    Sketch formula logic, report ideas and table structures before building.

    See ideas
  • 💻
    Laptop stands

    Make long spreadsheet sessions more comfortable and ergonomic.

    See ideas

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