Yes, you can remove text characters from a cell while keeping the numeric values intact in Excel. The fastest and most reliable way is to use the built-in Text to Columns tool combined with setting the column data format to General or Number, or by employing the SUBSTITUTE function to strip out specific non-numeric characters. This process works on both Windows and Mac versions of Excel.
What You'll Need
- Microsoft Excel (Windows, Mac, or the web version).
- A dataset containing cells with a mix of text and numbers (e.g., "Order #123" or "Price: $45.00").
Step-by-Step
The most robust method for removing arbitrary text characters—such as dashes, spaces, currency symbols, or letters attached to numbers—is the Text to Columns feature. This method does not require writing any formulas and handles large datasets efficiently.
- Select the Data: Click and drag to highlight the entire column or specific range of cells containing the mixed text and numbers that you want to clean.
- Open Text to Columns: Navigate to the Data tab located at the top of the Excel ribbon. In the Data Tools group, click the button labeled Text to Columns.
- Select Delimited: The Convert Text to Columns Wizard will open. On the first screen, select the radio button next to Delimited and click Next. (Selecting Fixed width is generally not necessary for this task as it relies on spaces or separators).
- Choose the Separator: On the second screen, look for the options labeled Tab, Comma, or Space. If your data contains spaces between text and numbers (e.g., "Total 100"), check the box next to Space. If the text and numbers are joined without spaces (e.g., "Total100"), you may need to add a custom delimiter by clicking Other and typing the character you wish to split by. For standard alphanumeric strings, checking Other and typing a space is the most common scenario. Click Next to proceed.
- Set Column Format: On the third and final screen, you will see a preview of your data split into columns. Highlight the column header representing the numeric data you wish to keep. In the bottom section labeled Column data format, select General. This ensures Excel recognizes the remaining characters as a number rather than text, allowing for future mathematical operations. Click Finish.
- Verify the Result: The text characters have been removed, and the numbers should now be isolated. If you notice that the numbers appear as dates or are left-aligned (indicating they are still text), return to the Data tab, click Text to Columns again, and select General on the final screen for that specific column.
Alternative Method: Using the SUBSTITUTE Function
If you need to remove specific characters (like a dollar sign or a specific letter) and replace them with nothing, the SUBSTITUTE function is ideal. This is particularly useful for cleaning data imported from other systems.
- Identify the Cells: Click on the cell where you want the cleaned number to appear. If you want to replace the original data, you can copy the formula or paste the values later.
- Enter the Formula: Type
=SUBSTITUTE(original_cell, "character_to_remove", ""). - Adjust the Formula: Replace
original_cellwith the actual cell reference (e.g., A1). Replace"character_to_remove"with the specific symbol or text you wish to delete. - Copy Down: Drag the fill handle (the small square at the bottom right of the cell) down to apply the formula to the rest of your dataset.
- Convert to Values (Optional): If you want to replace the original text cells with the pure numbers, copy the new column of numbers, right-click the original column header, and choose Paste Special. Select Values and click OK. This will overwrite the original data with the cleaned numbers.
Common Mistakes
Leaving Numbers as Text: A frequent error is that after cleaning the cells, the numbers remain left-aligned and cannot be summed. This happens if the data format is not set to General or Number in the final step of the Text to Columns wizard. Always ensure the column format is set correctly before finishing.
Removing Spaces Incorrectly: If your data is like "12345" (no spaces) and you select Space as a delimiter, Excel will fail to split the data. In such cases, you may need to check the Other box and insert a dummy character temporarily to split the data, then remove it, or use the SUBSTITUTE function to strip the character.
Overwriting Original Data: When using the Text to Columns method, Excel replaces the data in the original selection. If you need to keep the original mixed data for reference, ensure you copy the data to a blank column or worksheet first.
Tips
Using Find and Replace: For very specific, single-character replacements (like a hyphen or a comma), you can use Ctrl+H (Find and Replace). Type the character in the Find what field and leave the Replace with field blank. This is faster for simple cleanups but less reliable than Text to Columns for complex strings.
Flash Fill: If you are comfortable with Excel's AI capabilities (available in Excel 2013 and later), you can use Flash Fill. In the cell next to your data, type the first clean number. As you type, Excel will recognize the pattern and fill the rest of the column automatically. Press Ctrl+E to activate it.
Troubleshooting
The numbers are still left-aligned: If your cleaned numbers are left-aligned, they are still formatted as text. Go to the Home tab, find the Number Format dropdown (usually defaults to General or Short Date), and manually select Number. Alternatively, you can use the VALUE function to convert the text to a number: =VALUE(cleaned_cell).
Data is not splitting correctly: If the Text to Columns wizard does not split the data where you expect, check your separator settings. If you are on a Mac, the menu paths in the wizard may vary slightly, but the logic of selecting Delimited and the specific separator remains the same.
Formula not updating: If using the SUBSTITUTE function and the result does not update immediately, ensure that Automatic Calculation is enabled. Go to the Formulas tab and ensure the Calculate Now button is selected, or press F9 to calculate the sheet.
Frequently Asked Questions
Can I remove all text characters at once?
No, Excel functions like SUBSTITUTE require you to specify every character you want to remove individually. There is no "remove all non-numeric" button in the standard interface. You must use Text to Columns with a space delimiter or write a complex nested formula to strip everything except digits.
Does this work on Mac?
Yes, the Text to Columns feature is available on Mac. The menu is typically located under the Data tab in the toolbar, and the wizard steps are nearly identical to the Windows version.
What if the numbers are in the middle of the text (e.g., "ABC123DEF")?
Standard Text to Columns relies on delimiters (like spaces) to split data. If there is no delimiter, the entire string will be treated as one column. You would need to use a complex Formula or VBA (Visual Basic for Applications) script to extract only the numeric characters from within the string.
Will this remove decimals?
No, this method removes the text characters but keeps the decimal points and digits intact. For example, "Price: 12.50" will become 12.50, which is mathematically correct.
How do I remove text but keep the original cell format?
When using the Text to Columns method, the original cell format is overwritten. To keep the original format, paste the results into a new range first, or use a helper column to display the cleaned numbers without permanently altering the original data in place.