ExcelUnpackUnpack Excel, one formula at a time.
Log inSign up

Lesson 53 · Text search

SUBSTITUTE in Excel

SUBSTITUTE swaps every copy of one piece of text for another. =SUBSTITUTE(A2,"-",".") turns dashes into dots. Use "" as the new text to remove something.

Practice this lesson →Pro lesson. The first 4 lessons are free.

What you will learn

  • Swap text for other text with SUBSTITUTE
  • Remove characters by swapping them for ""

How it works

=SUBSTITUTE(A2,"-",".") changes every - into a dot.

=SUBSTITUTE(A2,"-","") removes every -.

Formulas at a glance

=SUBSTITUTE(A2,"-",".")swap
=SUBSTITUTE(A2,"-","")remove

Example

Write the formula to change the dashes in the first phone number to dots.

ABCDE
1PhoneWith dotsNo dashesTagWith spaces
2555-123-4567cat_and_dog
3555-987-6543red_hot_chili
4555-222-3333big_blue_sea
5555-404-1000snow_day

Click B2 and type =SUBSTITUTE(A2,"-","."), then press Enter.

The answer is 555.123.4567.

When to use it

  • Changing dashes to dots in phone numbers
  • Removing spaces or symbols
  • Fixing a word that is spelled wrong everywhere

Common mistakes

  • Using REPLACE insteadREPLACE works by position. SUBSTITUTE works by matching text.
  • Expecting it to ignore capitalsSUBSTITUTE matches capitals exactly.
  • Forgetting the quotesBoth the old and new text go in quotes.

Practice it on a real sheet

Reading is a start. Doing it is how it sticks. This lesson walks you through every click on a live spreadsheet and checks each answer.

SUBSTITUTE in Excel: how it works, with examples · ExcelUnpack