Arrow left
Back to guides
Google Sheets Formulas

SUBSTITUTE Function in Google Sheets: Explained

In this article, you will learn how to use the SUBSTITUTE formula in Google Sheets.

What is the SUBSTITUTE formula in Google Sheets?

The SUBSTITUTE formula in Google Sheets is a function that allows you to search for a specific string of text in a cell and replace it with a different string of text.

For example, you can use the SUBSTITUTE formula to replace specific words or characters in a cell or multiple instances of a line of text with a different string of text.

Your next financial spreadsheet could be right here!
100+ spreadsheet templates, from FP&A to tax planning.
Free Spreadsheet Templates

How do you use the SUBSTITUTE formula in Google Sheets?

To use the SUBSTITUTE formula in Google Sheets, you need to specify the following four arguments in the general syntax below:

=SUBSTITUTE(text_to_search, search_for, replace_with, [occurrence_number])

“text_to _search”, in which you want to search for and replace specific text strings. This can be the cell reference, or the manually input text enclosed in quotation marks.

“search_for” is a string of text you want to search for and replace within the original text.

“replace_with” is a string of text that you want to use as the replacement for the search string.

“occurrence_number” [Optional] defines how many “search_for” strings are replaced with “replace_with” text; by default, the formula replace all “search_for” strings with “replace_with” text strings.

Sheets tutorials availalble now in our free certificate program!
Learn basic and intermediate functions with digestible videos and instructions.
Enroll in LiveFlow Academy

For example, if you want to replace all occurrences of the word "dog" with the word "cat" in a sentence in cell A1, “A big dog plays with a small dog”,  you would use the following formula:

=SUBSTITUTE(A1, "dog", "cat")

This formula would search for the string "dog" in cell A1, and replace it with the string "cat" wherever it appears. The result should be “A big cat plays with a small cat”.

You can also use the optional fourth argument to specify the number of instances of the search string you want to replace. For example, assuming the same sentence, “A big dog plays with a small dog”, in cell A4,  if you want to substitute the first instance of the search string, you will use the following formula:

=SUBSTITUTE(A4, "dog", "cat", 1)

This formula would replace the first instance of the string "dog" with the string "cat", but leave any additional occurrences of the search string unchanged. Thus, the outcome of the formula should be “A big cat plays with a small dog”.

You can see how the two examples mentioned above look in Google Sheets in the following screenshot.

How to use the SUBSTITUTE formula in Google Sheets with examples

The SUBSTITUTE formula is a powerful and versatile tool for working with text in Google Sheets. It allows you to quickly and easily search for and replace specific text strings in a cell or range of cells.

Learn how LiveFlow can save you hours a month on financial reporting!
Just 30 minutes can change the way your business operates forever.
Book a Demo


Learn how to do this step-by-step in the video below 👇

Automate financial reporting with LiveFlow

Want to eliminate manual updates of your Excel & Google Sheets models?

Yes, show me how

Need help?

Our team is here to help you any time between 9am and 10pm EST.
Check Icon
Email us at: help@liveflow.io

Liked this article? Then you'll love the ones below