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

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

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

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

Last reviewed: