This page isn't translated yet, so its text is in English. Function names and formulas are shown in your Excel language.
Excel function · Changing text
SUBSTITUE(SUBSTITUTE)
Replaces a piece of text with another wherever it appears.
What it does
SUBSTITUTE finds every occurrence of a text and replaces it with another. You can limit it to one occurrence, such as only the second hyphen.
Syntax
=SUBSTITUE(text; old_text; new_text; [instance_num])Arguments in square brackets are optional, and … means you can add more of the same. In this Excel language, arguments are separated by ;
Arguments
- text
- The text to change, usually a cell.
- old_text
- The text to replace. It is case-sensitive.
- new_text
- What to put in its place. Use "" to delete it.
- instance_num
- Which occurrence to replace. Leave it out to replace all of them.
Example
A phone number uses hyphens. How do you show it with spaces instead?
| A | B | |
|---|---|---|
| 1 | Phone | With spaces |
| 2 | 030-555-0182 | 030 555 0182 |
The formula in B2:
=SUBSTITUE(A2;"-";" ")Result: 030 555 0182
Both hyphens in 030-555-0182 are replaced by a space, giving 030 555 0182. Leaving out the fourth argument replaces every occurrence.
Common mistakes
- Mixing up case. "ABC" doesn't match "abc", so nothing is replaced.
- Expecting a number back after removing characters. The result is still text; wrap it in
VALUEif you need a number.
In other Excel languages
Excel translates function names, and in some languages the argument separator too. Type the name your Excel shows.
| Excel language | Function name | Separator |
|---|---|---|
| English | SUBSTITUTE | , |
| Deutsch | WECHSELN | ; |
| Français | SUBSTITUE | ; |
| Español (España) | SUSTITUIR | ; |
| Español (México) | SUSTITUIR | , |
| 日本語 | SUBSTITUTE | , |
| 한국어 | SUBSTITUTE | , |
| 繁體中文 | SUBSTITUTE | , |
| ไทย | SUBSTITUTE | , |
| ខ្មែរ | SUBSTITUTE | , |
| Tiếng Việt | SUBSTITUTE | ; |