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])
| Argument | What it is |
|---|---|
| text_to_search | The original text. |
| search_for | What you want to replace. |
| replace_with | The new text; "" to delete. |
| occurrence_numberoptional | Which 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.
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.
In B2, remove the hyphens from the phone number.
| A | B | C | |
|---|---|---|---|
| 1 | Phone | Digits only | |
| 2 | 55-1234-5678 | ||
| 3 | 33-9876-5432 | ||
| 4 | 81-5555-0101 | ||
| 5 | 998-123-4567 | ||
| 6 | 222-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.