How to extract text only from alphanumeric string in Excel?
In many real-world Excel tasks, you may encounter situations where cells contain a mixture of letters and numbers—so-called alphanumeric strings. For example, data such as "Order2058", "User_15A", or "ID1234B" are quite common in exported reports, database outputs, or standardized codes. Sometimes, for further analysis or reporting, you might need to separate and extract only the text portion, leaving out all numeric elements. This article guides you through several practical methods to efficiently extract only the letter characters from alphanumeric strings in Excel, along with typical usage scenarios, precautions, and troubleshooting suggestions.
➤ Extract text only from alphanumeric string by using Defined Function in Excel
➤ Extract text only from alphanumeric string with Kutools for Excel
➤ Extract text only from alphanumeric string using an Excel formula

Extract text only from an alphanumeric string by using a User Defined Function (UDF) in Excel
At a glance
- Advantages: Dynamic extraction across large datasets; simpler than complex worksheet formulas; reusable in any workbook.
- Limitations: Requires enabling macros and saving as
.xlsm; custom functions recalculate and may impact performance on very large ranges.
If you are comfortable with VBA, creating a custom User Defined Function (UDF) lets you extract letter characters directly from any alphanumeric string. This is useful when built-in functions are insufficient or become overly complex.
A quick overview of the steps involved:
1. Select any cell where you want to use the extraction formula, then press Alt + F11 to open the Microsoft Visual Basic for Applications editor.
2. In the VBA editor, click Insert > Module to create a new module. Paste the following code into the module.
VBA: Extract letters only (ASCII A–Z)
Function TextOnly(pWorkRng As Range) As String
'Updatebyextendoffice
Dim xValue As String
Dim OutValue As String
xValue = pWorkRng.Value
For xIndex = 1 To VBA.Len(xValue)
If Not VBA.IsNumeric(VBA.Mid(xValue, xIndex, 1)) Then
OutValue = OutValue & VBA.Mid(xValue, xIndex, 1)
End If
Next
TextOnly = OutValue
End Function
3. Return to the worksheet and enter =TextOnly(A1) in a blank cell (replace A1 with your target). Press Enter, then drag the fill handle to apply down the column. The result shows only the letter characters extracted from each string.
This method does not modify your original data—the outputs appear in new cells/columns, keeping source data intact.
Troubleshooting and tips
- Enable macros & save format: Ensure macros are enabled and save the file as
.xlsmso the UDF persists. - Only letters by design: The function strips digits, punctuation, and symbols. Pass
TRUEas the second argument to keep spaces (e.g.,=TextOnly(A1, TRUE)). - Accented/Non-ASCII letters: The simple pattern
[A-Za-z]excludes characters likeé, ü. If you need broader alphabets, consider a RegExp version and extend the character ranges (e.g.,[A-Za-zÀ-ÖØ-öø-ÿ]) or normalize text first. - Blank/Error cells: The UDF returns an empty string for blanks or error values.
- Performance: UDFs recalc with the sheet. On very large ranges, consider converting results to values after extraction.
Extract text only from an alphanumeric string with Kutools for Excel
If you prefer a quicker, no-code solution, Kutools for Excel provides a convenient way to remove unwanted numbers and non-letter characters from cells. This method is ideal for users who regularly perform text cleanup, handle bulk data, or want to avoid writing VBA.
At a glance
- What it does: Removes digits and other non-letter characters to leave letters only.
- Best for: One-time or batch cleaning without formulas or macros.
Kutools for Excel offers a Remove Characters feature that can efficiently strip away non-letter content from selected cells.
Kutools for Excel includes more than 300 handy Excel tools to streamline your work. Free to try with no limitation for 30 days. Get it now
Here’s how to extract letters only:
1. Select the cell range containing the alphanumeric strings you want to process.
2. Go to Kutools > Text > Remove Characters. A dialog will appear. See screenshot:

3. In the Remove Characters dialog, the simplest way to keep letters only is to tick Non-alphabetic (sometimes labeled Non-alpha). This removes everything except A–Z characters. If your version doesn’t have this option, tick Numeric and Non-printing, and (optionally) use Custom to remove symbols you don’t want to keep. See screenshot:

4. Click OK. Kutools will process the selection and remove all non-letter content, leaving only the text portions in the selected cells.
Troubleshooting and tips
- In-place change: This action overwrites the selected cells. Copy to a new location first if you need to keep the originals.
- Keep certain characters: To retain spaces or symbols (e.g., hyphens), avoid Non-alphabetic and instead combine Numeric, Non-printing, plus Custom for precise control.
Learn more about Remove Characters
Kutools’ approach is best for one-time cleaning jobs and works on both small and large datasets. If you need a dynamic (auto-updating) result, consider using a formula or a VBA UDF instead.
Extract text only from an alphanumeric string using an Excel formula
For users who want a solution without VBA or add-ins, it’s possible to extract text characters using native Excel formulas. This solution is suitable for datasets where you need the extraction to be dynamic and formula-driven, especially if you are unable to use macros or third-party tools in your environment.
Here’s how you can do it using an array formula:
1. Select a blank cell where you want your result to appear (for example, B1), and enter the following formula (keeps letters A–Z only):
=TEXTJOIN("",
TRUE,
IF(
(CODE(MID(A1, ROW(INDIRECT("1:"&LEN(A1))), 1))>=65)*
(CODE(MID(A1, ROW(INDIRECT("1:"&LEN(A1))), 1))<=90) +
(CODE(MID(A1, ROW(INDIRECT("1:"&LEN(A1))), 1))>=97)*
(CODE(MID(A1, ROW(INDIRECT("1:"&LEN(A1))), 1))<=122),
MID(A1, ROW(INDIRECT("1:"&LEN(A1))), 1),
""
)
) 2. After typing the formula, press Ctrl+Shift+Enter if you are using Excel 2019 or earlier (this turns it into an array formula). If you are using Excel for Microsoft 365 or Excel 2021 and later, simply press Enter, as these support dynamic array formulas natively.
Replace A1 with the reference to your cell containing the alphanumeric string. The formula will return just the letters from each string. To apply the formula to more rows, drag the fill handle down from B1.
Parameters explained:
- MID and ROW(INDIRECT(...)) enumerate each character in the target cell.
- CODE checks ASCII ranges 65–90 (A–Z) and 97–122 (a–z) to keep letters only.
- TEXTJOIN concatenates the kept characters into a single string.
- Works best on moderate-length text (under 1,000 characters per cell); very long texts may slow performance.
This approach preserves your original data and doesn’t require any extra tools or macro settings. If you encounter errors, double-check cell references and the array formula entry method.
Troubleshooting and summary suggestions
- If you see errors (e.g.,
#VALUE!), verify your Excel version and array-entry (Ctrl+Shift+Enter for 2019 or earlier). - After extraction, scan results for unexpected spaces/characters and adjust as needed. Choose Kutools, VBA, or formulas based on your workflow.
Relative Articles:
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
All Kutools add-ins. One installer
Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.
- All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
- One installer, one license — set up in minutes (MSI-ready)
- Works better together — streamlined productivity across Office apps
- 30-day full-featured trial — no registration, no credit card
- Best value — save vs buying individual add-in