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.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Phone | With dots | No dashes | Tag | With spaces |
| 2 | 555-123-4567 | cat_and_dog | |||
| 3 | 555-987-6543 | red_hot_chili | |||
| 4 | 555-222-3333 | big_blue_sea | |||
| 5 | 555-404-1000 | snow_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.