In Excel: use =SUBSTITUTE(text, old_text, new_text) — it finds a piece of text by its content and swaps every occurrence for new text, or just the Nth occurrence if you add a fourth argument.
Syntax
Arguments
| Argument | Description | |
|---|---|---|
text | required | The text or cell whose content you want to change. |
old_text | required | The piece of text to find and replace, matched by its content. |
new_text | required | The text to put in place of old_text; use "" to remove old_text entirely. |
instance_num | optional | Which occurrence to replace (1 = first, 2 = second, …); omit to replace every occurrence. |
Related functions
In an empty cell type =SUBSTITUTE( and click the cell holding the text, such as A2.
Type a comma, then in quotes the text to find — for example "-" for a hyphen or CHAR(160) for a non-breaking space.
Type a comma, then the replacement text in quotes; use "" to delete the found text entirely.
Optionally add a comma and a number to replace only that occurrence (1 for the first, 2 for the second, and so on).
Close the bracket, press Enter, and fill the formula down the column.
What this does
SUBSTITUTE replaces text by CONTENT: you tell it the characters to look for and what to put in their place, and it swaps every match in the string. This is the key difference from REPLACE, which works by POSITION (a start point and a length) rather than by what the text actually says. Common uses are stripping a character by replacing it with "" (an empty string), swapping one word for another, and removing the non-breaking space CHAR(160) that breaks lookups. An optional fourth argument, instance_num, limits the swap to a single occurrence. Most people learn this as a sequence of clicks and forget it by next week; learning it as a pattern instead is what lets you apply it to the next, slightly different version of the problem without starting from scratch. That is the difference this page is trying to make. Treat “excel substitute function” as a small repeatable workflow rather than a one-off click you hope to remember next time. Use a small test block before the live file, so any surprise in the affected formula shows up while it is still harmless. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That turns a text operation that turns messy entries into clean, usable data into a method you can reuse, explain, and defend when the workbook leaves your screen.
A worked example
Cell A2 holds the phone number "+49-30-1234-5678". To strip every hyphen: =SUBSTITUTE(A2, "-", "") returns "+493012345678". To swap a word in B2 ("Annual Report") for another: =SUBSTITUTE(B2, "Annual", "Quarterly") returns "Quarterly Report". To replace only the second space in "one two three", add the instance: =SUBSTITUTE("one two three", " ", "_", 2) returns "one two_three". SUBSTITUTE is the go-to for content-based cleanup — stripping symbols, swapping words, and removing stray CHAR(160) spaces — whenever you know what the text says rather than where it sits. One habit worth forming early: name the cells that hold your inputs, so the formula reads in plain language instead of a string of cell addresses. A reviewer — or you in three months — can then follow the logic without decoding what B7 and D2 were supposed to mean, which is most of what makes a sheet maintainable.
In Google Sheets
Everything above works in Google Sheets too. Excel and Sheets share the formula syntax used here; only the surrounding menus are arranged differently. That portability is deliberate — learn it once and it follows you between the two tools and across Windows and Mac. Nothing on this page is behind a login: the tool runs entirely in your browser, the formula is shown in full with one-click copy, and the steps work the same on Windows and Mac. That is the whole promise here — the exact answer, a way to prove it on your own numbers, and just enough context to make it stick. The short version of “excel substitute function”: the answer is at the top of this page, the tool proves it on your own numbers, and the sections above explain why it holds so the next variation does not stump you. Excel rewards people who reference cells instead of typing values and who keep inputs separate from formulas, because that is what makes a result you can audit months later. Build it once, deliberately, with the live tool as a check, and you convert a one-off lookup into a reusable skill — which is the whole point of learning the why and not just the what.
Common mistakes
- Reaching for
SUBSTITUTEwhen you mean to replace by position —SUBSTITUTEmatches content; to overwrite characters at a known spot use REPLACE instead. - Forgetting that the match is case-sensitive: "Cat" and "cat" are treated as different, so the wrong case will not be swapped.
- Omitting instance_num and replacing every occurrence when you only wanted one — add the fourth argument to target a single match.
Frequently asked questions
What is the difference between SUBSTITUTE and REPLACE?
SUBSTITUTE finds text by its content and swaps matching characters, while REPLACE overwrites a fixed number of characters at a position you give it. Use SUBSTITUTE when you know what the text says, REPLACE when you know where it sits.
How do I remove a character from a cell?
Substitute it with an empty string: =SUBSTITUTE(A2, "-", "") deletes every hyphen. The same pattern strips spaces, slashes, or the non-breaking space CHAR(160) with =SUBSTITUTE(A2, CHAR(160), "").
Is SUBSTITUTE case-sensitive?
Yes. It only swaps text that matches the case of old_text exactly, so "USD" and "usd" are different. To ignore case you would first standardise the text with UPPER or LOWER.
Other ways people ask this
This guide also answers
- substitute formula in excel