Skip to main content

📝 Latest Blog Post

How to Use the TRIM Function in Excel (Remove Extra Spaces)

How to Use the TRIM Function in Excel (Remove Extra Spaces)

Messy data with irregular spacing is common in Excel, especially when data is imported. The TRIM() function helps remove all extra spaces from a text string—leaving only single spaces between words.

📘 Syntax:

=TRIM(text)

✅ Example:

=TRIM(A2)

If A2 contains " John Doe ", the result will be "John Doe".

🎯 When to Use:

  • Before matching text using VLOOKUP or XLOOKUP
  • To clean up names and addresses in reports
  • For consistent formatting before exporting data

🧠 Bonus Tip:

Combine with CLEAN() to remove non-printable characters:
=TRIM(CLEAN(A2))

Follow ScriptDataInsights for more tips on Excel data cleanup and automation!

Comments

🔗 Related Blog Post

🌟 Popular Blog Post