Google Sheets SUBSTITUTE function

Replaces some text with other text inside a cell. In Spanish Sheets it is called SUSTITUIR.

Syntax

English Sheets

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

Spanish Sheets (Mexico locale)

=SUSTITUIR(texto_para_buscar, cadena_búsqueda, reemplazar_con, [número_caso])

Spanish Sheets (Spain, Latin America)

=SUSTITUIR(texto_para_buscar; cadena_búsqueda; reemplazar_con; [número_caso])

ArgumentWhat it is
text_to_searchThe original text.
search_forWhat you want to replace.
replace_withThe new text; "" to delete.
occurrence_numberoptionalWhich occurrence to replace; all if omitted.

Example

SUBSTITUTE(text, search_for, replace_with) replaces some text with other text inside a cell. With "" as the replacement, it deletes it.

=SUBSTITUTE(A2,"-","")

Common mistake

It is case-sensitive. To replace by pattern use REGEXREPLACE.

About Ads

This site uses Google AdSense to display ads. These ads help us keep WebHerramientas completely free. Ads are managed by Google and meet strict security and privacy standards.

Advertising
Loading ad...

Ads help us keep WebHerramientas free for everyone

Practice SUBSTITUTE

Type the formula in the sheet and check it instantly. Spanish or English function names both work. See all lessons

SUBSTITUTE

SUBSTITUTE(text, search_for, replace_with) replaces some text with other text inside a cell. With "" as the replacement, it deletes it.

Example=SUBSTITUTE(A2,"-","")SUSTITUIR = SUBSTITUTE

In B2, remove the hyphens from the phone number.

B2
ABC
1PhoneDigits only
255-1234-5678
333-9876-5432
481-5555-0101
5998-123-4567
6222-765-4321
7

Tip: while typing, click a cell or drag across several to insert their reference.

Frequently asked questions

What is SUBSTITUTE called in Spanish?
In Spanish Google Sheets it is SUSTITUIR. The formula =SUBSTITUTE(A2,"-","") is written =SUSTITUIR(A2;"-";"") (or with commas under a Mexico locale).
Why does SUBSTITUTE use semicolons in some spreadsheets?
It depends on each spreadsheet's locale, under File > Settings. Where the comma is the decimal mark (Spain, much of South America), arguments are separated by semicolons. Mexico and United States locales use commas.
What is the most common SUBSTITUTE mistake?
It is case-sensitive. To replace by pattern use REGEXREPLACE.