Module 8 · Text · Fix the phone numbers

Dana Novak manages the office at Copperleaf Dental

The last problem in the export: phone numbers. The software writes 201/555/0142, but the phone system needs 201-555-0142. And from June, the area code 201 changes to 551. Dana fixes all numbers with two formulas.

Loading the spreadsheet…

Module 8 · Text

Fix the phone numbers

Dana Novak, manages the office at Copperleaf Dental
Dana Novak manages the office at Copperleaf Dental

The last problem in the export: phone numbers. The software writes 201/555/0142, but the phone system needs 201-555-0142. And from June, the area code 201 changes to 551. Dana fixes all numbers with two formulas.

Steps

  1. Replace a character with SUBSTITUTE

    SUBSTITUTE replaces each copy of a text with a new text. You do not need to know where it is.

    How to do it

    1. Select the cell for the result.
    2. Type =SUBSTITUTE( and the cell with the text. Type a comma.
    3. Type the old text and the new text in quotes. Type a closing bracket.
    4. Press Enter.
    5. To remove a character, replace it with an empty text: =SUBSTITUTE(C5,"/","").

    =SUBSTITUTE(C5,"/","-")

    Task: Fix all phone numbers. Fill in D6:D12.

  2. Replace characters at a position with REPLACE

    REPLACE replaces characters at a position. You tell it where to start and how many characters to replace.

    How to do it

    1. Click cell E5.
    2. Type =REPLACE( with the text, the start position and the number of characters.
    3. Type the new text in quotes and a closing bracket.
    4. Press Enter.
    5. SUBSTITUTE looks for a text. REPLACE uses a position. SUBSTITUTE(D5,"201","551") would also change 201 in the middle of a number.

    =REPLACE(D5,1,3,"551")

    Task: Change the area code of all numbers. Fill in E6:E12.