Returning Specific Characters in a Field

  • Last update:May 14, 2025
  • Overview

    Problem

    In some cases, you may want to obtain a specific segment from a field.

    For example, you may want to obtain the last few characters of fixed length from a string. The following figure shows the effect.

    Solution

    You can use the Split Field function to split the field with one click, or use the text functions to obtain specific characters from a field.

    Returning Characters of Fixed Length

    Procedure

    You can download the sample data Supplier Info.xlsx.

    Method One

    Choose More > Split Field on the data editing page to enter the function page, as shown in the following figure.

    Split the field by the separator (-) and enter 2 in Split Result, as shown in the following figure.

    Method Two

    Taking the RIGHT function as an example, you can obtain the last eight digits of Phone Number to create the RIGHT Function field.

    1. Create an analysis subject with the sample data Supplier Info, click Field Settings, and select the Contact Name and Phone Number fields, as shown in the following figure.

    4.png

    2. Click Formula Column and add the RIGHT Function column using the RIGHT function. The obtained column returns the last eight digits of phone numbers, as shown in the following figure.

    The following table introduces the functions.

    FunctionImplemented Function
    LEFTReturns characters on the left of the string.
    RIGHTReturns characters on the right of the string.
    MIDReturns a certain number of characters from the specified position in the text string.

    Effect Display

    In this case, you can obtain the last few characters of fixed length from a string. The following figure shows the effect.

    Returning All Characters Before a Specific Character

    You can use the LEFT and FIND functions. The FIND function can locate a character in a string.

    You can download the sample data Field Interception.xlsx.

    Procedure

    For example, you can obtain user accounts and create the LEFT Interception (Unfixed) field from the User Account and Password field.

    1. Create an analysis subject with the downloaded Field Interception table. All fields are selected by default.

    2. Click Formula Column, name the column LEFT Interception (Unfixed), enter the formula LEFT(User Account and Password,FIND(":",User Account and Password)), and click OK, as shown in the following figure.

    iconNote:
    If you do not need colons (:) in the field, you can modify the formula to LEFT(User Account and Password,FIND(":",User Account and Password)-1).

    The following table explains the formula.

    FormulaDescription
    LEFT(User Account and Password,FIND(":",User Account and Password)) Returns characters in the field from left to right, with the number of characters to be obtained determined by the position index of the colon (:) found in the field using the FIND() function.

    Effect Display

    In this case, you can obtain all characters from the first character to the colon (:) in the string, as shown in the following figure.

    Returning All Characters Behind a Specific Character

    You can use the RIGHT, FIND, and LEN functions.

    You can use the sample data in section "Returning All Characters Before a Specific Character."

    Procedure

    Method One

    1. Choose More > Split Field on the data editing page to enter the function page, as shown in the following figure.

    Split the field by the separator (:) and enter 2 in Split Result, as shown in the following figure.

    Method Two

    You can obtain the passwords from the User Account and Password field and create the Password column.

    Click Formula Column, name the column Password, enter the formula RIGHT(User Account and Password,LEN(User Account and Password)-FIND(":",User Account and Password)), and click OK, as shown in the following figure.

    The following table explains the formula.

    FormulaDescription
    LEN(User Account and Password)-FIND(":",User Account and Password)The number of characters to be returned is equal to the length of the field obtained using the LEN() function minus the position index of the colon (:) found in the field using the FIND() function.
    RIGHT(User Account and Password,LEN(User Account and Password)-FIND(":",User Account and Password))Characters in a field are returned from right to left.

    Effect Display

    In this case, you can obtain all characters after the colon (:), as shown in the following figure.

    Returning Characters of Unfixed Length From a Specific Character

    You can download the sample data Field Interception (Unfixed Length).xlsx.

    You can obtain the passwords from the middle of the User Account and Password field, and create a column.

    Procedure

    Method One

    Choose More > Split Field on the data editing page to enter the function page, as shown in the following figure.

    Split the field by the separator (:) and enter 2 in Split Result, as shown in the following figure.

    Repeat the above steps and split the User Account and Password-2 field by the comma (,), as shown in the following figure.

    Method Two

    1. Create an analysis subject with the downloaded Field Interception (Unfixed Length) table. All fields are selected by default.

    2. Click Formula Column, name the column LEFT Interception (Unfixed Length), enter the formula MID(User Account and Password,FIND(":",User Account and Password)+1,FIND(",",User Account and Password)-FIND(":",User Account and Password)-1), and click OK, as shown in the following figure.

    The following table explains the formula.

    FormulaDescription
    FIND(":",User Account and Password)+1To obtain the starting position of the characters to be returned, you can use the FIND() function to obtain the position index of the colon (:) and then add one to the position index obtained. One represents the length of the colon (:).
    FIND(",",User Account and Password)-FIND(":",User Account and Password)-1To obtain the length of characters to be returned, you can subtract the position index of the colon (:) from the position index of the comma (,), and subtract one.
    MID(User Account and Password,FIND(":",User Account and Password)+1,FIND(","User Account and Password)-FIND(":",User Account and Password)-1)Characters representing the passwords from the User Account and Password string behind the colon (:) are returned.

    Effect Display

    In this case, you can obtain all characters between the colon (:) and the comma (,), as shown in the following figure.

    Removing Characters of Fixed Length in a String

    You can download the sample data Text Interception.xlsx.

    Procedure

    1. Create an analysis subject with the downloaded Text Interception table. All fields are selected by default.

    2. Click Formula Column, name the column Remove the Suffix, and enter the formula LEFT(Company,LEN(Company)-6), and click OK, as shown in the following figure.

    The following table explains the formula.

    FormulaDescription
    LEN(Company)-6Obtains the length of the Company field minus 6.
    LEFT(Company,LEN(Company)-6)Returns the (LEN(Company)-6) characters from the left of the Company field.

    Effect Display

    In this case, the Office suffix is removed from the field and only the company names are saved, as shown in the following figure.

    iconNote:
    If you need to remove characters of fixed length from a field, you can use RIGHT(Field,LEN(Field)-Number of Characters).


    附件列表


    主题: System Management
    Previous
    Next
    • 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