SUBSTITUTE

    Text

    Replaces specific text within a string. Useful for cleaning or transforming data.

    Translations
    EnglishSUBSTITUTE
    FrenchSUBSTITUE
    SpanishSUSTITUIR
    GermanWECHSELN
    ItalianSOSTITUISCI
    PortugueseSUBSTITUIR
    DutchSUBSTITUEREN
    PolishPODSTAW
    RussianПОДСТАВИТЬ
    TurkishYERİNEKOY
    CzechDOSADIT
    HungarianHELYETTE
    SwedishBYT.UT
    DanishUDSKIFT
    FinnishKORVAA
    Syntax
    SUBSTITUTE(text, old_text, new_text, [instance_num])

    Arguments

    • textThe text containing text to replace
    • old_textThe text to find and replace
    • new_textThe replacement text
    • instance_numWhich occurrence to replace (all if omitted)(optional)
    Examples
    =SUBSTITUTE("Hello World","World","Excel")
    Hello Excel

    Replaces 'World' with 'Excel'

    =SUBSTITUTE(A1," ","")
    No spaces

    Removes all spaces

    =SUBSTITUTE(A1,"-","/",1)
    First only

    Replaces only first dash

    Tips & Best Practices
    • Case-sensitive - 'A' and 'a' are different
    • Replaces all occurrences unless instance_num specified
    • Use REPLACE for position-based replacement
    Common Mistakes
    • Confusing SUBSTITUTE with REPLACE - SUBSTITUTE matches text by content, REPLACE matches by character position, and picking the wrong one leads to replacing the wrong occurrence or none at all
    • Forgetting that SUBSTITUTE is case-sensitive when matching old_text, so SUBSTITUTE("Excel","excel","Sheets") makes no replacement at all since the case doesn't match
    • Omitting the optional instance_num argument when only one specific occurrence should change, causing SUBSTITUTE to replace every matching occurrence in the string instead of just the intended one
    Related Functions
    REPLACEReplaces text based on a fixed starting position and length rather than by matching the text itself.
    FINDLocates the position of text within a string, useful for determining instance_num values before using SUBSTITUTE.
    TRIMOften paired with SUBSTITUTE to remove specific unwanted characters, like non-breaking spaces, that TRIM alone won't catch.
    Frequently Asked Questions

    What's the difference between SUBSTITUTE and REPLACE?

    SUBSTITUTE finds and replaces text by matching its content, while REPLACE swaps out characters based on a starting position and length you specify - use SUBSTITUTE when you know the text to find, REPLACE when you know exactly where it sits.

    Is SUBSTITUTE case-sensitive?

    Yes, old_text must match the case in the source text exactly, or no replacement happens.

    How do I replace only the second occurrence of a word?

    Add the instance_num argument, like SUBSTITUTE(A1,"cat","dog",2), which replaces only the second occurrence and leaves the rest untouched.

    Need to translate a formula using SUBSTITUTE?

    Use our translator to convert your complete formula