Google Sheets SUBSTITUTE Function

This post will guide you how to use Google Sheets SUBSTITUTE function with syntax and examples.

Description


The Google Sheets SUBSTITUTE function replaces a new text string for an old text string in a text string.

The SUBSTITUTE function can be used to replace existing text with new text in a string in google sheets.  The purpose of this function is to replace text based on content. And its returned value is the processed text.

The SUBSTITUTE function is a build-in function in Google Sheets and it is categorized as a Text Function.

Syntax


The syntax of the SUBSTITUTE function is as below:

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

Where the SUBSTITUTE function arguments are:

  • Text -This is a required argument. The text string that containing the old text to be substituted with new text string.
  • Old_text – This is a required argument. The substring that you want to replace.
  • New_text – This is a required argument. The new substring to replace Old_text substring with.
  • Instance_num– This is an optional argument.  The number value will specify which occurrence of old substring you want to replace with new substring. By default, all occurrences of old_text are replaced.

Note:

  • If Instance_numvalue is omitted, every occurrence of old substring will be replaced with new substring.
  • The SUBSTITUTE function used to replace text based on matching and not position.
  • The SUBSTITUTE function is case-sensitive.
  • Old_text will match parts of words as well as whole words. For example, searching a string “sh” will also replace text within “sheets”.
  • SUBSTITUTE function can only be used to replace one or all instances of a string within new_text in a single cell.
  • SUBSTITUTE function returns text as the output. If a number output is desired, and you can try using the VALUE function in combination with this function.

Google Sheets SUBSTITUTE Function Examples


The below examples will show you how to use google sheets SUBSTITUTE function to replace old substring with a new substring.

#1 To substitute first instance of “google”old text string with a new text string “mygoogle” in B1 cell, just using formula:

=SUBSTITUTE(B1,”google”,” mygoogle”,1).

google sheets substitute function

#2 To substitute second instance of “google”old text string with a new text string “googlefunction” in B1 cell, just using formula:

=SUBSTITUTE(B1,”google”,”googlefunction “,2)

google sheets substitute function

Note: You can use the REPLACE function to replace a newly text string at a given position in a text string. And you can use the SUBSTITUTE function to replace an existing text with a new text in a string. And Using FIND function or SEARCH function to get the location of a given text string in a text sting.

 

 

 

 

 

 

Related Posts

Google Sheets NOW Function
google sheets now function1

This post will guide you how to use Google Sheets NOW function with syntax and examples. Description The Google Sheets NOW function returns the serial number of the current date and time. And it will be updated each time when ...

Google Sheets NETWORKDAYS.INTL Function
google sheets networkdays.intl function1

This post will guide you how to use Google Sheets NETWORKDAYS.INTL function with syntax and examples. Description The Google Sheets NETWORKDAYS.INTL function returns the number of net working days between tow given days excluding specified weekend days and holidays. The ...

Google Sheets NETWORKDAYS Function
google sheets networkdays function1

This post will guide you how to use Google Sheets NETWORKDAYS function with syntax and examples. Description The Google Sheets NETWORKDAYS function returns the number of net working days between tow given days. The NETWORKDAYS function can be used to ...

Google Sheets MONTH Function
google sheets month function1

This post will guide you how to use Google Sheets MONTH function with syntax and examples. Description The Google Sheets MONTH function returns the month of a date represented by a serial number. And the month is an integer number ...

Google Sheets MINUTE Function
google sheets minute function1

This post will guide you how to use Google Sheets MINUTE function with syntax and examples. Description The Google Sheets MINUTE returns the minutes of a time value. And the minutes is an integer number from 0 to 59. So ...

Google Sheets ISOWEEKNUM Function
google sheets isoweeknum function1

This post will guide you how to use Google Sheets ISOWEEKNUM function with syntax and examples. Description The Google Sheets ISOWEEKNUM returns the number of the ISO week of the year for a given date. ISO weeks begin on Monday ...

Google Sheets HOUR Function
google sheets hour function1

This post will guide you how to use Google Sheets HOUR function with syntax and examples. Description The Google Sheets HOUR returns the hour of a time value. Or returns an integer value that represent the hour component of a ...

Google Sheets EOMONTH Function
google sheets eomonth function1

This post will guide you how to use Google Sheets EOMONTH function with syntax and examples. Description The Google Sheets EOMONTH returns a date representing the last day of the month, n months in the future or past. The EOMONTH ...

Google Sheets EDATE Function
google sheets edate function1

This post will guide you how to use Google Sheets EDATE function with syntax and examples. Description The Google Sheets EDATE returns a date that is a specified number of months before or after a specified date. You can use ...

Google Sheets DAYS360 Function
google sheets days360 function1

This post will guide you how to use Google Sheets DAYS360 function with syntax and examples. Description The Google Sheets DAYS360 will calculate the number of days between two dates based on a 360-day year. The DAYS360 function can be ...

Sidebar