REPLACE

    Text

    Replaces part of a text string with a different text string, based on position.

    Translations
    EnglishREPLACE
    FrenchREMPLACER
    SpanishREEMPLAZAR
    GermanERSETZEN
    ItalianRIMPIAZZA
    PortugueseMUDAR
    DutchVERVANGEN
    PolishZASTĄP
    RussianЗАМЕНИТЬ
    TurkishDEĞİŞTİR
    CzechNAHRADIT
    HungarianCSERE
    SwedishERSÄTT
    DanishERSTAT
    FinnishKORVAA.TEKSTI
    Syntax
    REPLACE(old_text, start_num, num_chars, new_text)

    Arguments

    • old_textThe original text
    • start_numPosition to start replacing
    • num_charsNumber of characters to replace
    • new_textThe replacement text
    Examples
    =REPLACE("Hello",1,1,"J")
    Jello

    Replaces first character

    =REPLACE(A1,5,3,"XXX")
    Text with XXX

    Replaces 3 chars starting at position 5

    =REPLACE("2023-01",1,4,"2024")
    2024-01

    Updates year in date string

    Tips & Best Practices
    • Position starts at 1, not 0
    • Use SUBSTITUTE to replace by content instead of position
    • Can insert text by setting num_chars to 0
    Common Mistakes
    • Confusing REPLACE with SUBSTITUTE - REPLACE swaps text based on a fixed starting position and character count, while SUBSTITUTE matches by content, and using the wrong one leads to replacing the wrong characters entirely
    • Miscounting the start_num or num_chars arguments, especially after the source text changes length, silently replacing the wrong slice of the string
    • Forgetting REPLACE works on a fixed character count, not a delimiter or pattern - it can't dynamically find where a piece of text ends the way SUBSTITUTE or FIND-based logic can
    Related Functions
    SUBSTITUTEReplaces text by matching content rather than by position, the more common choice when you don't know the exact character positions.
    MIDExtracts a substring by position, useful for verifying start_num and num_chars visually before using REPLACE.
    FINDCan supply the starting position dynamically to REPLACE when the exact location of text to replace isn't fixed.
    Frequently Asked Questions

    What's the difference between REPLACE and SUBSTITUTE?

    REPLACE swaps text based on a starting position and number of characters you specify, while SUBSTITUTE finds and replaces text by matching its actual content - use REPLACE when you know exactly where the text sits, SUBSTITUTE when you know what the text says.

    Why did REPLACE remove the wrong characters?

    The start_num or num_chars arguments likely don't match the current text - this often happens after the source text's length changes and the fixed position no longer lines up.

    Can REPLACE find text automatically instead of using a fixed position?

    Not on its own, but combining it with FIND lets you calculate the starting position dynamically instead of hardcoding it.

    Need to translate a formula using REPLACE?

    Use our translator to convert your complete formula