SUBSTITUTE Function
Replaces every occurrence (or a chosen one) of some text with new text.
Category
Text
Available in
All versions, Microsoft 365
Returns
Text
Overview
SUBSTITUTE finds specific text and swaps it for something else — every time it appears, or just the occurrence you pick.
It's a formula version of Find & Replace, and a building block for counting characters and words.
Syntax
=SUBSTITUTE(text, old_text, new_text, [instance_num])
Arguments
| Argument | Required? | What it does |
|---|---|---|
| text | Yes | The original text. |
| old_text | Yes | The text to replace. Case-sensitive. |
| new_text | Yes | What to put in its place. "" removes it. |
| instance_num | Optional | Which occurrence to replace. Leave it out to replace them all. |
Examples
Example 1 — Renaming a company
Northstar changed its legal suffix from Ltd to Inc.
B2fx=SUBSTITUTE(A2, "Ltd", "Inc")
| A | B | |
|---|---|---|
| 1 | Old | New |
| 2 | Northstar Ltd | Northstar Inc |
| 3 | Northstar Ltd – West | Northstar Inc – West |
| 4 | Supplier Co | Supplier Co |
=SUBSTITUTE(A2, "Ltd", "Inc") Explain
Example 2 — Only the second dash
Change the second dash in a SKU to a slash.
B2fx=SUBSTITUTE(A2, "-", "/", 2)
| A | B | |
|---|---|---|
| 1 | SKU | Result |
| 2 | NS-1042-BLU | NS-1042/BLU |
| 3 | NS-2210-RED | NS-2210/RED |
=SUBSTITUTE(A2, "-", "/", 2) Explain
Example 3 — Counting a character
How many commas are in a cell? Compare the length with and without them.
=LEN(A2)-LEN(SUBSTITUTE(A2, ",", "")) Explain
Common mistakes
- Case-sensitive. SUBSTITUTE won't touch “LTD” when you ask for “Ltd”. Nest two SUBSTITUTEs or use REGEXREPLACE with case-insensitive matching.
Notes
- Related functions: REPLACE, TRIM, LEN, REGEXREPLACE.

Author
Kyle Stott
Certified Microsoft Excel Expert
Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.