SUBSTITUTE Function

SUBSTITUTE Function

SUBSTITUTE Function

Finds specific text inside a string and replaces it with something else.

ExcelClash Team
PUBLISHED

Summary

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.

Purpose

Replace text by content

Finds matching text and replaces it with new text.

Return Value

A modified text string

Returns the original string with the matched text replaced.

Syntax

=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.

Arguments

  • text - [Required] The original text string or cell reference.
  • old_text - [Required] The text you want to replace. SUBSTITUTE is case-sensitive.
  • new_text - [Required] The replacement text. Use "" to remove the matched text.
  • instance_num - [Optional] The matching occurrence to replace. Omit it to replace all occurrences.

SUBSTITUTE vs Other Functions

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

Using SUBSTITUTE

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.

  • Use SUBSTITUTE when you know the exact text that should change.
  • Use the 4th argument when only one occurrence should be replaced.
  • Use "" as the replacement text when you want to remove something entirely.

Example 1 - Updating a Year Across a Label

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"
Check Answer
Challenge #1
Target: Sheet1!F1
Update a Year in a Label

In cell F1, use SUBSTITUTE on A2 ("Excel-2021") to replace "2021" with "2024".

Example 2 - Replacing Only a Specific Occurrence

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"
Check Answer
Challenge #2
Target: Sheet1!F2
Replace the Second Hyphen Only

In cell F2, use SUBSTITUTE on A3 ("A-A-A") to replace only the second hyphen with "B". Use the optional 4th argument.

Example 3 - Removing a Character Entirely

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"
Check Answer
Challenge #3
Target: Sheet1!F3
Remove a Character Entirely

In cell F3, use SUBSTITUTE on A2 to remove all hyphens by replacing them with nothing (""). Expected: "Excel2021".

Example 4 - Swapping a Separator Character

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"
Check Answer
Challenge #4
Target: Sheet1!F4
Swap a Separator Character

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.

Conclusion Recap

  • Summary: SUBSTITUTE replaces text by matching content.
  • Syntax: =SUBSTITUTE(text, old_text, new_text, [instance_num]).
  • Key point: SUBSTITUTE is case-sensitive and replaces all matches unless you target one occurrence.
  • Practical usage: Cleaning text, updating labels, removing symbols, and changing separators.
  • Best pattern: Use an empty replacement string when you want to remove matched text.
Tactical Arena
Select Scenario:
Share SUBSTITUTE Function!

Tell your friends about this post

Discussion

ExcelClash is an interactive platform designed to level up your Excel skills through real-world exercises and challenges. Sharpen your logic, solve real spreadsheet problems, and learn faster.

© 2026 ExcelClash, Inc. All rights reserved.