Cellgrids Cellgrids
Home › Excel formulas › Text › TRIM + SUBSTITUTE

TRIM + SUBSTITUTE Function in Excel: Syntax, Examples and Free Practice

By Rinkesh Shah, founder of Cellgrids.

TRIM + SUBSTITUTE is an Excel Text function. Combines SUBSTITUTE (to collapse double spaces) with TRIM (to remove leading/trailing spaces) for thoroughly cleaned text.

TRIM + SUBSTITUTE syntax

=TRIM(SUBSTITUTE(text, " ", " "))

Arguments

When to use TRIM + SUBSTITUTE

Cleaning up messy pasted data that has random double-spaces scattered through it.

Practice TRIM + SUBSTITUTE online, free

Open the live Excel-style spreadsheet and try TRIM + SUBSTITUTE yourself. No Excel install or sign-up needed to start.

Practice TRIM + SUBSTITUTE now →

More Text functions

Frequently asked questions

What does the TRIM + SUBSTITUTE function do in Excel?

Combines SUBSTITUTE (to collapse double spaces) with TRIM (to remove leading/trailing spaces) for thoroughly cleaned text.

What is the syntax of TRIM + SUBSTITUTE in Excel?

The syntax is =TRIM(SUBSTITUTE(text, " ", " ")). text: Text that may have inconsistent spacing.

Where can I practice TRIM + SUBSTITUTE online for free?

Open the free live spreadsheet on Cellgrids and try TRIM + SUBSTITUTE yourself. No Excel install is needed and you can start without signing up.

All Excel formulas · Cheat sheet · Excel exercises · Text functions · Excel case studies · Excel tutorials · Excel shortcuts