Excel Formula to Remove Non-Numeric Characters from Phone Numbers

📅 Sep 08, 2026 📝 Sarah Miller

Cleaning inconsistent phone number data-often cluttered with dashes, spaces, and parentheses-frequently stalls crucial marketing campaigns. While securing standard funding sources drives major IT upgrades, everyday data hygiene remains a manual hurdle for teams. Utilizing an advanced Excel formula grants immediate standardization across databases, unlocking seamless communication pipelines. However, this approach carries the stipulation that users must account for varying international formats. For instance, nested SUBSTITUTE formulas or TEXTJOIN arrays effectively isolate pure digits. Below, we provide the step-by-step formula configurations to automate your data cleansing process.

Excel Formula to Remove Non-Numeric Characters from Phone Numbers

Managing customer relationship management (CRM) databases, contact lists, or lead sheets often comes with one major headache: inconsistent phone number formatting. One contact might enter their number as +1 (555) 123-4567, another as 555.123.4567, and yet another as 555-123-4567 ext 99.

To run SMS marketing campaigns, integrate with click-to-call VoIP dialers, or simply maintain a clean database, you need these numbers formatted uniformly. While Excel's "Format Cells" tool allows you to apply custom formatting templates, it only works if the cell contents are purely numeric. If a cell contains text characters like parentheses, spaces, dashes, or periods, Excel treats the cell as a text string, and custom formatting rules will fail completely.

To resolve this, you must first strip away all non-numeric characters, leaving behind only the raw digits. Once you have a clean string of numbers, you can format them exactly how you want. This guide details how to build formulas in Excel to replace non-numeric characters and format phone numbers dynamically.

The Core Problem: Why Excel's "Format Cells" Fails on Raw Text

If you select a cell containing (555) 123-4567, right-click, select Format Cells, choose Special, and click Phone Number, nothing happens. This is because Excel's built-in formatting engine only works on raw numerical values (like 5551234567). When the cell contains non-numeric text characters (such as parentheses or hyphens), Excel treats the entire cell as text, rendering number formatting useless.

Therefore, our target workflow must be:

  1. Identify and strip out all alphabetical characters, punctuation marks, and whitespaces.
  2. Extract only the numerical digits (0 through 9).
  3. Apply the desired aesthetic format (e.g., (555) 123-4567) to the clean numerical string.

Method 1: The Modern Excel Approach (Excel 365 & 2021)

If you are using modern versions of Excel (such as Excel 365 or Excel 2021), you have access to powerful dynamic array formulas. These functions allow us to inspect each character of a text string individually, discard the ones that are not numbers, and join the remaining digits back together.

The ultimate modern formula for stripping non-numeric characters is:

=TEXTJOIN("", TRUE, IFERROR(IF(ISNUMBER(MID(A2, SEQUENCE(LEN(A2)), 1)*1), MID(A2, SEQUENCE(LEN(A2)), 1), ""), ""))

How this Formula Works Step-by-Step:

  • LEN(A2): Calculates the total character length of the original phone number in cell A2.
  • SEQUENCE(LEN(A2)): Generates an array of sequential numbers starting from 1 up to the total length of the text string. For example, if the text is 12 characters long, it creates the array {1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12}.
  • MID(A2, SEQUENCE(LEN(A2)), 1): Extracts each character of the text string one by one, creating an array of individual characters.
  • *1 (Multiplication by 1): Excel tries to multiply each extracted character by 1. If the character is a digit (e.g., "5"), it successfully converts it to a number (5). If the character is a text symbol or space (e.g., "-" or "("), it returns a #VALUE! error.
  • ISNUMBER(...): Checks if the multiplication resulted in a valid number.
  • IF(...): If the character is indeed a number, the formula returns the original character string; otherwise, it returns an empty string (""). This step ensures we preserve leading zeros (since converting "0" to a raw number directly can sometimes cause issues).
  • TEXTJOIN("", TRUE, ...): Concatenates the array of numbers back into a single string, skipping any empty values (the discarded non-numeric characters).

Using the LET Function for Cleaner Formulas

If you prefer a cleaner, easier-to-read version of this formula, you can use the LET function to define variables:

=LET(
    raw_text, A2,
    char_array, MID(raw_text, SEQUENCE(LEN(raw_text)), 1),
    numeric_only, IFERROR(IF(ISNUMBER(char_array*1), char_array, ""), ""),
    TEXTJOIN("", TRUE, numeric_only)
)

Method 2: The Classic Nested SUBSTITUTE Formula (Excel 2019 and Older)

If you are working on an older version of Excel that does not support dynamic arrays or the SEQUENCE and TEXTJOIN functions, you must fall back on nested SUBSTITUTE functions.

This method works by targeting and stripping out specific characters that are commonly found in phone numbers (spaces, dashes, parentheses, periods, and plus signs).

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2, "-", ""), " ", ""), "(", ""), ")", ""), ".", "")

Limitations of this Approach:

While this formula is backward-compatible with every version of Excel, it has notable limitations:

  • It only removes the characters you explicitly define. If a user enters a character you did not account for (such as /, #, or alphabetical characters like ext), the formula will fail to remove them.
  • To remove more characters, you have to nest even more SUBSTITUTE functions, which quickly makes the formula long and difficult to debug.

Method 3: Power Query (The Ultimate Solution for Large Datasets)

If you are dealing with thousands of rows of data, using complex formulas can slow down your workbook's performance. Power Query is an excellent tool built into Excel that can easily clean up data upon import.

How to Clean Phone Numbers via Power Query:

  1. Select your data table, navigate to the Data tab, and click From Table/Range.
  2. In the Power Query Editor, click on the Add Column tab and select Custom Column.
  3. Name your new column (e.g., Clean_Phone).
  4. Enter the following M-code formula:
    Text.Select([Phone], {"0".."9"})
  5. Click OK. This command instructs Power Query to look at your original phone column and extract only the characters within the range of 0 to 9.
  6. Go to the Home tab, click Close & Apply, and your clean numbers will be loaded back into a new worksheet.

Re-formatting the Cleaned Numbers

Once you have isolated the raw numeric digits using any of the cleaning methods above, you can apply your desired uniform presentation style. You can achieve this by nesting your cleaning formula inside Excel's TEXT function.

Standard 10-Digit US/Canada Format: (555) 123-4567

Assuming your cleaned numeric string is now in cell B2, use the following formula to format it:

=TEXT(B2*1, "(###) ###-####")

Note: Multiplying the cleaned string by 1 (B2*1) converts the text back into a raw number, which the TEXT function requires to apply formatting masks.

Handling 11-Digit Numbers with Country Codes

If your dataset contains a mix of 10-digit local numbers and 11-digit numbers that include a country code (e.g., 15551234567), you can use an IF statement to check the string length and format accordingly:

=IF(LEN(B2)=11, TEXT(B2*1, "+# (###) ###-####"), TEXT(B2*1, "(###) ###-####"))

Combining Cleaning and Formatting Into One Step

To bypass creating helper columns, you can combine the modern extraction formula and the formatting function into a single, comprehensive formula:

=LET(
    raw_text, A2,
    char_array, MID(raw_text, SEQUENCE(LEN(raw_text)), 1),
    cleaned_string, TEXTJOIN("", TRUE, IFERROR(IF(ISNUMBER(char_array*1), char_array, ""), "")),
    IF(LEN(cleaned_string)=10, TEXT(cleaned_string*1, "(###) ###-####"), TEXT(cleaned_string*1, "+# (###) ###-####"))
)

Summary: Which Method Should You Use?

Method Ideal For Pros Cons
Modern Array Formula (Excel 365) Active, dynamic workbooks with changing contact sheets. Completely dynamic; automatically strips all non-numeric characters without hardcoding lists. Not compatible with older Excel versions (2019 and older).
Nested SUBSTITUTE Users on legacy Excel editions. Compatible with all Excel versions. Can become incredibly complex and fails on unlisted characters.
Power Query Large, static data imports (e.g., importing CSV logs from a CRM). Highly performant on massive datasets; repeatable steps. Requires manual refresh when data changes.

By using these formulas and workflows, you can save hours of manual data entry and ensure your contact databases remain accurate, standardized, and ready for your outreach campaigns.

Disclaimer:
The documents and templates provided on this page are for informational and illustrative purposes only. They do not constitute professional, legal, or financial advice, and should not be relied upon as such. Because individual circumstances and regulatory requirements vary, these materials may not be suitable for your specific needs. We recommend consulting with a qualified professional before adapting or using any of these examples for official or commercial purposes.