fxExcelReps
PRO

You've used your 3 free functions

To practise SUBSTITUTE and every other function, get a PRO subscription.

  • Unlimited access to every function
  • New functions and exercises every month
  • Every mistake explained + full solutions

Your free functions — you can always come back to these:

← All functions

How to use SUBSTITUTE in Excel

SUBSTITUTE replaces specific text inside a text — remove dashes from phone numbers, fix abbreviations, swap separators.

Syntax

=SUBSTITUTE(text, old_text, new_text, [instance_num])

textThe original text.
old_textWhat to replace.
new_textWhat to put instead ("" to delete).
[instance_num]Replace only the n-th occurrence (all if omitted).

Examples

=SUBSTITUTE(A2, "-", "")"359-88-123" → "35988123".
=SUBSTITUTE(A2, "Ltd", "Limited")Expand an abbreviation.
=LEN(A2)-LEN(SUBSTITUTE(A2, ",", ""))Count the commas in a text.

Clean data before you calculate

Amounts and IDs exported from other systems often carry spaces, dashes or the wrong decimal sign. SUBSTITUTE removes them, and -- turns the clean text into a number.

=--SUBSTITUTE(A2, " ", "")"12 840" becomes the number 12840.
=--SUBSTITUTE(SUBSTITUTE(A2, ".", ""), ",", ".")"12.840,50" (European format) becomes 12840.5.
=SUBSTITUTE(A2, CHAR(160), " ")Turns non-breaking spaces from web pages into normal ones.

Replace only one occurrence

The 4th argument says which occurrence to replace. Without it, SUBSTITUTE replaces all of them.

=SUBSTITUTE(A2, "-", "/", 2)Only the second dash: 2026-11-30 becomes 2026-11/30.
=SUBSTITUTE(A2, " ", "", 1)Removes only the first space.

Several replacements in one formula

Nest one SUBSTITUTE inside another. Each one works on the result of the one inside it.

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2, "(", ""), ")", ""), " ", "")A phone number without brackets and spaces.

Common mistakes

Case-sensitive
"ltd" won't replace "Ltd".
Replace by position instead
To replace characters at a position (not by content), use REPLACE.

Frequently asked questions

What's the difference between SUBSTITUTE and REPLACE?

SUBSTITUTE replaces a text wherever it is. REPLACE replaces characters at a position: =REPLACE(A2, 1, 2, "XX") changes the first two characters, whatever they are.

Is SUBSTITUTE case-sensitive?

Yes. =SUBSTITUTE(A2, "ltd", "Ltd") doesn't touch "LTD". Use UPPER or PROPER first if the case varies.

Why is the result still text after I removed the spaces?

SUBSTITUTE always returns text. Put -- in front, or VALUE around it, to get a number that SUM and lookups understand.

Should I use SUBSTITUTE or Find & Replace?

Ctrl+H is faster for a one-off clean-up. SUBSTITUTE is better when new data arrives every month, because the formula cleans it again by itself.

Available in: All versions of Excel, Excel for the web, Google Sheets

Related functions

TRIMFINDLENTEXTJOIN