Removing letters from numbers in Excel is a common data cleaning task that transforms messy text strings into usable numerical values. Whether you are working with product codes like "A12345" or phone numbers formatted as "(123) 456-7890", Excel provides several robust methods to strip out non-numeric characters. This guide explores multiple techniques, from simple formula-based approaches to more advanced Power Query solutions, ensuring you can handle any dataset with confidence.

Understanding the Challenge

The core issue arises when numeric data is stored as text, often accompanied by letters, symbols, or spaces. Standard mathematical operations fail on these entries, and sorting behaves incorrectly, treating values as text rather than numbers. Before applying a solution, it is crucial to identify the specific pattern of the unwanted characters. Are they leading alphabetic prefixes, trailing currency symbols, or erratic spacing? Diagnosing the structure of your data dictates which removal method will be most efficient and accurate.
Method 1: Using SUBSTITUTE for Specific Characters

The SUBSTITUTE function is ideal when you know the exact character or text string you want to remove. This method is straightforward and highly readable. For instance, if your cell contains "USD 1,234" and you wish to remove the currency code, you can nest multiple SUBSTITUTE functions to target each unwanted element sequentially.
- Remove spaces:
=SUBSTITUTE(A1, " ", "") - Remove specific letters:
=SUBSTITUTE(A1, "ABC", "") - Handle multiple characters by nesting functions:
=SUBSTITUTE(SUBSTITUTE(A1, "(", ""), ")", "")

While powerful for simple cases, this method can become cumbersome if the variety of characters is high, as it requires modifying the formula for every unique character.
Method 2: The Versatile TEXTJOIN with FILTERXML Trick
For a more dynamic solution that extracts only the digits, combining TEXTJOIN and FILTERXML creates a robust formula. This approach scans the string character by character and rebuilds it using only the numeric characters (0-9). The formula requires a specific XML string wrapper to function correctly, but once set up, it adapts to any length of input data without manual adjustments.

The structure involves converting the string into an array of individual characters, filtering for digits, and then reassembling them. This method is particularly useful for data with unpredictable layouts, such as serial numbers or mixed-format descriptions, where the position of letters varies significantly from cell to cell.
Advanced Automation with Power Query
When dealing with large datasets or performing this task repeatedly, Power Query offers the most scalable and maintainable solution. Unlike cell formulas that clutter your worksheet, Power Query operates in a separate editor, allowing you to build a reusable transformation pipeline. The process involves loading your data into Power Query, selecting the target column, and applying a "Replace Values" or custom "Transform" using a function that isolates numbers.

- Select your data range and click "Get Data" > "From Table/Range" in Excel.
- In the Power Query Editor, choose the column containing the text.
- Use "Transform" > "Format" > "Strip HTML Tags" as a base or create a custom column with the logic to remove non-numeric characters.
- Click "Close & Load" to output the clean numbers directly to a new worksheet.
This method keeps your original data intact and ensures that any future updates to the source file can be refreshed with a single click.




















Utilizing VBA for Maximum Flexibility
For users comfortable with coding, a custom VBA (Visual Basic for Applications) function provides ultimate flexibility. By writing a simple macro, you can define exactly what constitutes a "number" in your specific context—whether you want to keep decimals, handle negative signs, or ignore certain symbols. This function then behaves like any native Excel formula, allowing you to apply the logic across thousands of rows with ease.
The VBA approach is ideal for enterprise environments where standardized data processing is critical. Once the function is installed in your workbook's module, it becomes a permanent tool in your analytical arsenal, streamlining workflows that would otherwise require complex nested formulas.
Data Type Conversion and Error Handling
After successfully removing the letters, the resulting text string might still behave like text in the eyes of Excel. To ensure the output is a true numerical value capable of calculation, you must convert the format. A common trick is to add zero to the cleaned string (e.g., =CleanedCell + 0) or to wrap the formula in the VALUE function. Alternatively, using the -- (double unary) operator forces Excel to interpret the text as a number.
Always check for errors such as #VALUE! which occur if the cleaning process results in an empty string. Wrapping your final output in the IFERROR function allows you to handle these edge cases gracefully, returning a zero or a blank instead of an error message that disrupts downstream analysis.
Best Practices and Maintenance
To ensure long-term reliability, document the method you choose directly within your worksheet or accompanying documentation. If you use complex formulas, consider breaking them down into helper columns to make debugging easier. For teams, standardizing on one method—such as Power Query—reduces confusion and ensures consistency across different files and users.
Finally, always backup your original data before applying bulk transformations. While the techniques discussed here are reliable, having a copy allows you to revert changes if the pattern of the source data changes unexpectedly or if a new format emerges during data collection.