logo
excelfunctions.org
bookmarks

SUBSTITUTE

Substitutes new text for old text in a text string.

TextMost UsedText CleaningText Processing

What it does

Replaces occurrences of old text with new text in a string.

Syntax

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

Arguments

  • text(text) β€” Original text.
  • old_text(text) β€” Text to replace.
  • new_text(text) β€” Replacement text.

Examples

Replace dashes with spaces

Convert A2 from dashed to spaced.

FORMULA
=SUBSTITUTE(A2,"-"," ")
RESULT
INV 1042
SAMPLE DATA
A
1Code
2INV-1042
3PO-0088