FormulaCraft

How to find and replace text with a formula in Excel and Google Sheets

Topic:Text manipulation
Excel & Google Sheets
=SUBSTITUTE(A2,"old","new")

Verified example

Computed by a real spreadsheet engine on the sample data below.

OriginalResult
cat sat on mat
hat and cat
catalog entry
catfish recipe
cat nap time

=SUBSTITUTE(A2,"old","new")cat sat on mat

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Enter =SUBSTITUTE(A2,"old","new") — replace "old" with the text to find and "new" with the replacement.
  2. 2SUBSTITUTE replaces ALL occurrences by default. To replace only the Nth occurrence, add a fourth argument: =SUBSTITUTE(A2,"o","0",2) replaces only the 2nd "o".
  3. 3SUBSTITUTE is case-sensitive — "Apple" and "apple" are treated differently.
  4. 4To replace case-insensitively you must use REPLACE with SEARCH to locate the position first.

Tips

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

Frequently asked

What is the difference between SUBSTITUTE and REPLACE?

SUBSTITUTE finds a specific text value anywhere in the string; REPLACE targets a fixed character position and length.

Can I use wildcards in SUBSTITUTE?

No — SUBSTITUTE matches literal text only. Use REGEXREPLACE in Google Sheets for pattern-based replacements.

More on Text manipulation

See all →

Formulas used

Related tasks

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: