REPLACE - Replacing Part of a Text

  • Last update:  2023-08-22
  • Usage 1: Replacing Specified Content of a Text

    Overview

    Grammar

    REPLACE(text,textorreplace,replacetext)

    Replaces the specified character string in the original text with a different character string.

    Parameter 1

    text

    Text or referenced cell containing the characters to be replaced

    Parameter 2

    textorreplace

    Specified character string

    Parameter 3

    replacetext

    Text in which the original character string needs to be replaced

    Notes

    • The function supports three parameters of any type.

    Example

    For example, if you want to replace Cold in the Product name column with Flu, as shown in the following figure.

    REPLACE1.png

    Add a calculation indicator and enter the formula REPLACE(Product name},"Cold","Flu"), as shown in the following figure.

    REPLACE2.png

    More examples:

    FormulaResultNotes
    REPLACE("abcd","a","re")rebcd-
    REPLACE("a**d","**d","rose")arose-

    Usage 2: Replacing the String Starting from a Specified Position of a Text

    Overview

    Grammar

    REPLACE(old_text,start_num,num_chars,new_text)

    Replaces a specified number of characters in a text, with a different character string.

    Parameter 1

    Old_text

    Text or referenced cell containing the characters to be replaced

    Parameter 2

    Start_num

    Starting position of the text where old_text is to be replaced with new_text

    Parameter 3

    Num_chars

    Number of characters in old_text to be replaced with new_text

    Parameter 4

    New_text

    Text in which the original character string needs to be replaced

    Notes

    • The function supports four parameters, among which the first and fourth are of any type, and the second and third are numeric.

    Example

    Take the data desensitization of telephone numbers as an example.

    FormulaResultNotes
    REPLACE("0123456789",5,4,"*")0123*89/
    REPLACE("1980",3,2,"99")1999/



    附件列表


    主题: Advanced Data Analyis
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy