Cellwise Try it free

Text function

Excel SUBSTITUTE function

SUBSTITUTE swaps one piece of text for another inside a cell. By default it replaces every match, or you can choose which one. Use it to strip dashes from phone numbers, rename codes, or remove unwanted characters.

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

Arguments

text
The text or cell to change.
old_text
The text to replace. It is case sensitive.
new_text
The replacement. Use "" to delete the old text.
instance_num
Which match to replace, like 2 for the second. Leave it out to replace all.

SUBSTITUTE examples

Every result below was calculated from this sample sheet by the same spreadsheet engine the Cellwise app uses.

ABC
1PhoneItemPath
2(555) 201-7788Blue Shirt - Blue Trimreports/2025/q1/sales.csv
3555.310.4421Red Mugreports/2025/q2/sales.csv
  1. =SUBSTITUTE(A3,".","-")

    Result: 555-310-4421

    Replaces every dot with a dash: "555-310-4421".

  2. =SUBSTITUTE(B2,"Blue","Navy")

    Result: Navy Shirt - Navy Trim

    Both "Blue"s become "Navy".

  3. =SUBSTITUTE(B2,"Blue","Navy",2)

    Result: Blue Shirt - Navy Trim

    With instance_num 2, only the second "Blue" changes.

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

    Result: 5552017788

    Nested SUBSTITUTEs strip brackets, spaces and dashes: "5552017788".

How to use SUBSTITUTE

  1. Type =SUBSTITUTE( and select the cell.
  2. Add the text to find, in quotes.
  3. Add the replacement in quotes, or "" to delete.
  4. Optionally add which instance to replace, then close the bracket.

Common SUBSTITUTE mistakes

Case does not match

SUBSTITUTE is case sensitive, so "blue" will not replace "Blue". Match the case exactly.

Confusing it with REPLACE

SUBSTITUTE swaps by matching text. REPLACE swaps by position and length.

Numbers come back as text

The result is always text. Wrap it in VALUE if you need a number.

SUBSTITUTE FAQ

How do I remove a character from a cell in Excel?

Replace it with empty text: =SUBSTITUTE(A2,"-","") removes every dash.

What is the difference between SUBSTITUTE and REPLACE in Excel?

SUBSTITUTE finds text by content, like every "-". REPLACE changes characters at a fixed position, like characters 4 to 6.

How do I replace multiple different characters at once?

Nest SUBSTITUTE calls, one per character: =SUBSTITUTE(SUBSTITUTE(A2,"(",""),")","").

Practice SUBSTITUTE in these lessons

Guides that use SUBSTITUTE

Related functions

Updated