
Finds specific text inside a string and replaces it with something else.
The Excel SUBSTITUTE function replaces specific text inside a string. You tell Excel what text to find and what to replace it with, and the function returns the updated result.
That makes SUBSTITUTE different from REPLACE. REPLACE works by position, while SUBSTITUTE works by matching text content. If you know the word, symbol, or substring you want to change, SUBSTITUTE is often the better tool.
Finds matching text and replaces it with new text.
Returns the original string with the matched text replaced.
=SUBSTITUTE(text, old_text, new_text, [instance_num])
text is the source string. old_text is what you want to find. new_text is what should replace it. instance_num is optional and lets you replace only one matching occurrence instead of all of them.
"" to remove the matched text.Use SUBSTITUTE when you know what text should change. Use REPLACE when you know where the change should happen.
| Function | Works By | Use When |
|---|---|---|
SUBSTITUTE |
Matching text content | You know what text to replace |
REPLACE |
Character position | You know where the replacement starts |
LOWER / UPPER |
- | You need to normalize case before a case-sensitive replacement |
SUBSTITUTE is useful when the same word, symbol, or separator appears in many rows and needs to be changed consistently. Because it works by content, you do not have to calculate character positions first.
It is also useful for cleaning text. If you replace a character with an empty string, that character is removed. This is a common pattern for stripping spaces, hyphens, or other unwanted symbols.
"" as the replacement text when you want to remove something entirely.If the old year is known, SUBSTITUTE can replace it directly without needing to know where it sits in the string.
=SUBSTITUTE(A2, "2021", "2024")
// "Excel-2021" -> "Excel-2024"
In cell F1, use SUBSTITUTE on A2 ("Excel-2021") to replace "2021" with "2024".
The optional instance_num argument is useful when the same character appears several times but only one match should change. If you omit it, all matches are replaced.
=SUBSTITUTE(A3, "-", "B", 2)
// "A-A-A" -> "A-BA"
In cell F2, use SUBSTITUTE on A3 ("A-A-A") to replace only the second hyphen with "B". Use the optional 4th argument.
If the replacement text is empty, SUBSTITUTE removes the matched text. This is a common way to strip unwanted symbols from imported values.
=SUBSTITUTE(A2, "-", "")
// "Excel-2021" -> "Excel2021"
In cell F3, use SUBSTITUTE on A2 to remove all hyphens by replacing them with nothing (""). Expected: "Excel2021".
SUBSTITUTE can also convert one separator style into another. This is useful when data needs to be prepared for a different format or system.
=SUBSTITUTE(A2, "-", "/")
// "Excel-2021" -> "Excel/2021"
In cell F4, use SUBSTITUTE on A2 to replace all hyphens with forward slashes. Expected: "Excel/2021".
SUBSTITUTE is case-sensitive. If you search for "excel", it will not match "Excel". If the source data uses inconsistent capitalization, normalize it first or use another approach.
SUBSTITUTE replaces text by matching content.=SUBSTITUTE(text, old_text, new_text, [instance_num]).Tell your friends about this post