Skip to main content
SheetCraft
🔤 Text Function · beginner

SUBSTITUTE Function in Google Sheets

Replaces specified text with new text, optionally only the Nth occurrence. Find-and-replace without regex.

Syntax

SUBSTITUTE(text, search_for, replace_with, [occurrence])

Returns: text with replacements.

Excel equivalent: SUBSTITUTE (identical)

Parameters

NameRequiredDescription
textRequiredString to operate on.
search_forRequiredSubstring to find.
replace_withRequiredReplacement text.
occurrenceOptionalOnly Nth occurrence. Omitted = all.

Examples

Remove spaces

=SUBSTITUTE(A2, " ", "")

Normalize phone numbers.

Second occurrence only

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

Only the second dash.

Chained

=SUBSTITUTE(SUBSTITUTE(A2, "$", ""), ",", "")

Strip $ AND , for currency cleanup.

When to use an alternative

  • REGEXREPLACEPattern-based.
  • REPLACEReplace by position.

Common errors and how to fix them

  • Case-sensitive surprise

    Cause: SUBSTITUTE IS case-sensitive.

    Fix: Use REGEXREPLACE with (?i).

Related functions

Frequently Asked Questions

Case-sensitive?

Yes — rare case-sensitive function in Sheets. "Apple" ≠ "apple".

vs REPLACE?

SUBSTITUTE finds text. REPLACE removes by position.

Source: Google Sheets official function reference.