Removing Numbers from Text in Excel: A Step-by-Step Guide

Abstract: Remove numeric digits from text strings in Excel using dynamic array formulas or VBA for accurate data cleaning.

Created: 2026-10-23 by
To remove numbers from text in Excel, the most reliable method for modern versions is using a combination of LET, MID, and SEQUENCE to filter characters. This approach iterates through each character, checks if it is numeric, and retains only letters or symbols. For older Excel versions without dynamic arrays, a VBA User Defined Function provides an equally robust solution. These techniques ensure that data cleaning processes remain accurate regardless of the specific version of Microsoft Excel you are utilizing.

The Modern Formula Approach

The previous attempt using TEXTAFTER failed because that function is designed to extract text after a specific delimiter, not to filter individual characters based on a property like "is number." It does not support array-based filtering logic natively. Instead, we must construct a formula that evaluates every single character in the string. For users with Excel 365 or Excel 2021+, the following formula achieves this by breaking the text into individual characters, testing them, and reassembling the result. Enter this formula in cell B2, assuming your source text is in A2:
=LET(
    text, A2,
    len, LEN(text),
    chars, MID(text, SEQUENCE(len), 1),
    isNum, ISNUMBER(chars+0),
    keep, IF(NOT(isNum), chars, ""),
    CONCAT(keep)
)
This formula uses the LET function to define variables for clarity and performance. First, it calculates the length of the text string. Then, it uses SEQUENCE to generate an array of positions from 1 to the length of the string. The MID function extracts each character one by one. The critical step is ISNUMBER(chars+0). By adding zero to the text characters, Excel attempts to convert them to numbers. If the character is a digit (0-9), the conversion succeeds, and ISNUMBER returns TRUE. If it is a letter or symbol, the conversion fails, returning FALSE. We then use IF to keep the character if it is NOT a number, otherwise replacing it with an empty string. Finally, CONCAT joins all the remaining non-numeric characters back together into a single string. If you prefer a slightly more compact version without LET, you can nest these functions directly, though it may be harder to read:
=CONCAT(IF(NOT(ISNUMBER(MID(A2,SEQUENCE(LEN(A2)),1)+0)),MID(A2,SEQUENCE(LEN(A2)),1),""))
Note that this formula will also remove spaces if you consider spaces as part of the "text" you want to strip, but typically numbers refer to digits 0-9. If you need to preserve spaces, you should modify the condition to explicitly check for digits rather than just checking if the value is numeric. However, for standard alphanumeric cleaning, the above method is highly effective.

Handling Edge Cases and Spaces

When removing numbers, you might notice that leading or trailing spaces can sometimes cause issues if the original data was padded. Additionally, some users may want to remove numbers even if they are embedded within words, such as turning "Item123" into "Item". The formula provided above handles this seamlessly because it operates on a character-by-character basis. It is important to remember that this formula creates a dynamic array output. In Excel 365, this spills automatically to adjacent cells. If you are copying this formula down a column, ensure there is enough empty space below the first instance to allow the spill range. If you encounter a #SPILL! error, clear any data blocking the range. For those who find dynamic arrays confusing or are working in a shared environment where formulas might behave unexpectedly, the next section details a VBA alternative that works in all versions of Excel. You can also look at Convert Multiple Lines to Single Cell in Excel if you need to consolidate results after cleaning your data.

VBA Solution for All Excel Versions

If you are using Excel 2019 or earlier, or simply prefer a custom function that behaves like a native worksheet function, VBA is the best path. This method is faster for large datasets and does not rely on volatile array operations. To implement this, press Alt + F11 to open the Visual Basic Editor. Insert a new module via the Insert menu and paste the following code:
Function RemoveNumbers(ByVal txt As String) As String
    Dim i As Long
    Dim charCode As Integer
    Dim result As String
    
    result = ""
    
    For i = 1 To Len(txt)
        charCode = Asc(Mid(txt, i, 1))
        
        ' Check if character is NOT a digit (ASCII 48-57)
        If charCode < 48 Or charCode > 57 Then
            result = result & Mid(txt, i, 1)
        End If
    Next i
    
    RemoveNumbers = result
End Function
This function loops through each character in the input string. It checks the ASCII value of each character. Digits '0' through '9' have ASCII values between 48 and 57. If the character's ASCII code falls outside this range, it is appended to the result string. Otherwise, it is skipped. Once saved, you can use this function in your spreadsheet just like any other formula. Simply enter =RemoveNumbers(A2) in cell B2. This is particularly useful if you have thousands of rows to clean, as VBA functions are generally more efficient than complex array formulas in older Excel versions.

Comparing Methods and Best Practices

Choosing between the formula and VBA methods depends on your specific needs. The LET formula is ideal for quick, ad-hoc cleaning tasks in modern Excel environments. It requires no macro-enabled workbooks and is easy to audit. However, it can be slow on very large datasets due to the creation of intermediate arrays. The VBA approach is superior for performance and compatibility. It works in Excel 2007 through 365 and does not create memory overhead associated with dynamic arrays. However, it requires saving the file as a Macro-Enabled Workbook (.xlsm), which may be a security concern in some corporate environments. Regardless of the method chosen, always test your cleaning process on a small sample dataset before applying it to your entire database. Incorrectly removing characters can lead to data loss, especially if numbers are part of identifiers like SKUs or Product Codes. If you need to group similar values after cleaning, see Excel Formula to group similar values for further processing steps.

Frequently Asked Questions

Can I remove numbers while keeping spaces?

Yes, both the formula and VBA methods described above preserve spaces because their ASCII codes are outside the 48-57 range reserved for digits. The logic specifically targets numeric characters, leaving whitespace intact.

What if I want to remove letters instead of numbers?

You would invert the logic. In the formula, change NOT(isNum) to isNum. In VBA, change the condition to If charCode >= 48 And charCode <= 57 to keep only digits.

Does this work in Google Sheets?

The LET and SEQUENCE functions are supported in Google Sheets, so the formula approach works identically. However, the VBA code will not work; you would need to write a Google Apps Script equivalent.

How do I handle negative signs when removing numbers?

The current methods treat the minus sign (-) as a non-number character, so it will be preserved. If you want to remove negative signs along with numbers, you must add an additional check for the ASCII code 45 in your logic.

Is there a built-in Excel feature for this?

No, Excel does not have a native "Remove Numbers" button in the Ribbon. Power Query can achieve this using advanced M language code, but it is more complex for simple cell-level operations compared to the formulas provided here.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More