Excel SUBSTITUTE Function

There are two ways to “excel substitute function”: the quick way you copy and the durable way you understand. This page gives you both. The exact Excel answer is above; below, we build the small mental model that makes the fix stick, so the next variation of the same problem solves itself.

Exact answer

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.

On this page8

Syntax

=SUBSTITUTE(text, old_text, new_text, [instance_num])

Arguments

Argumentrequired / optionalDescription
textrequiredThe text or cell whose content you want to change.
old_textrequiredThe piece of text to find and replace, matched by its content.
new_textrequiredThe text to put in place of old_text; use "" to remove old_text entirely.
instance_numoptionalWhich occurrence to replace (1 = first, 2 = second, …); omit to replace every occurrence.

Related functions

TRIMLEFT/RIGHT/MIDTEXTJOIN
▤Annotated stepsExcel
1

In an empty cell type =SUBSTITUTE( and click the cell holding the text, such as A2.

2

Type a comma, then in quotes the text to find — for example "-" for a hyphen or CHAR(160) for a non-breaking space.

3

Type a comma, then the replacement text in quotes; use "" to delete the found text entirely.

4

Optionally add a comma and a number to replace only that occurrence (1 for the first, 2 for the second, and so on).

5

Close the bracket, press Enter, and fill the formula down the column.

Ctrl+CthenCtrl+Shift+V⌘+Cthen⌘+Ctrl+VPaste values · WindowsMac

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. Check the referenced cells, argument order and result type in your workbook. Start with the worked example before changing an input, then compare the changed result with the calculation you expected. An error value or a result of a different type is a reason to inspect the inputs and arguments.

In Google Sheets

Google Sheets support for this task has not been verified. Check the function, arguments and workflow in the target product before transferring the example. Matching formula notation does not establish identical behaviour. Nothing on this page is behind a login or a download: the exact answer is at the top, and the detail below it is there for when you need it. That is the whole promise here — the answer first, and just enough context to make it stick. For “excel substitute function”, keep the input cells and the result visible while you check the formula in Excel. Follow the worked example and change one input at a time. The steps explain the workbook calculation; this page does not run a live calculator for that task.

Common mistakes

  • Reaching for SUBSTITUTE when you mean to replace by position — SUBSTITUTE matches 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.