AnalystPracticeGuides
DashboardSign up

The Excel SUBSTITUTE function

SUBSTITUTE swaps one piece of text for another inside a cell: =SUBSTITUTE(text, old_text, new_text, [instance]). It is case-sensitive and replaces every occurrence unless you give an instance number.

What are typical uses?

Remove dashes from a phone number:

=SUBSTITUTE(A2,"-","")

Turn a European decimal comma into a dot before converting to a number:

=VALUE(SUBSTITUTE(B2,",","."))

Replace only the second space:

=SUBSTITUTE(A2," ","|",2)

How do you count how often a character appears?

Compare the length before and after removing it. Number of commas in A2:

=LEN(A2)-LEN(SUBSTITUTE(A2,",",""))

SUBSTITUTE or REPLACE?

SUBSTITUTE works on the text you name. REPLACE works on a position: =REPLACE(A2,1,3,"XYZ") replaces the first three characters, whatever they are.

Common mistake

SUBSTITUTE is case-sensitive, so "Ltd" won't replace "LTD". Clean the case first with UPPER or LOWER if needed.

Try it yourself. Practise this in a real spreadsheet in your browser, with instant feedback.
Practise SUBSTITUTE

Updated November 2026.

← All free guides