Extract Only Text in Excel: Removing Numbers and Special Characters

📅 Oct 22, 2026 📝 Sarah Miller

Data professionals frequently struggle to clean messy data cluttered with system-generated numbers and punctuation. When consolidating records from standard funding sources, raw data often arrives corrupted with system noise. Fortunately, establishing clean reporting databases grants organizations immediate operational clarity and saves hours of manual correction. Note this vital stipulation: executing this advanced text-clearing technique requires Excel 365's dynamic array formulas. For example, converting string codes like "US-890_Grant" into "US Grant" requires a robust logical filter. Below, we will outline the exact step-by-step formula using REDUCE and LAMBDA to automate this extraction.

Extract Only Text in Excel: Removing Numbers and Special Characters

Excel Formula to Extract Text Excluding Numbers and Special Characters

When working with imported data, web scraps, or system migrations in Microsoft Excel, you often encounter "dirty" data. Text strings frequently get mixed up with unwanted numbers, symbols, and punctuation marks. For instance, you might have a SKU or client name stored as "J@m3s_99_B0nd!", when you actually need it to be cleaned to "JamesBond" or "James Bond".

Historically, solving this problem required complex VBA macros or tedious manual editing. However, with modern Excel functions, we can build dynamic formulas to isolate alphabetic characters. In this comprehensive guide, we will explore several methods to extract text while excluding numbers and special characters, ranging from cutting-edge dynamic array formulas to Power Query and VBA.


Method 1: The Modern Excel 365 Formula (Best Dynamic Solution)

If you are using Excel 365 or Excel 2021, you have access to dynamic arrays and helper functions like LET, SEQUENCE, MAP, and FILTER. These functions allow us to dissect a string into individual characters, evaluate them against ASCII code parameters, filter out the unwanted characters, and join them back together.

The Formula (Preserving Spaces)

To extract only letters (A-Z and a-z) while keeping spaces, use this formula (assuming your raw text is in cell A2):

=LET(
    chars, MID(A2, SEQUENCE(LEN(A2)), 1),
    codes, MAP(chars, LAMBDA(c, CODE(UPPER(c)))),
    CONCAT(FILTER(chars, ((codes >= 65) * (codes <= 90)) + (chars = " "), ""))
)

The Formula (Removing Spaces)

If you want a continuous string of text without spaces (e.g., "JamesBond"), remove the space evaluation condition:

=LET(
    chars, MID(A2, SEQUENCE(LEN(A2)), 1),
    codes, MAP(chars, LAMBDA(c, CODE(UPPER(c)))),
    CONCAT(FILTER(chars, (codes >= 65) * (codes <= 90), ""))
)

How It Works: Step-by-Step

Let's break down the logic of this formula using the LET function, which assigns names to calculation steps for readability and performance:

  • chars (Split String): MID(A2, SEQUENCE(LEN(A2)), 1) creates an array of every single character in the cell. For "Ab1#", it generates {"A", "b", "1", "#"}.
  • codes (Convert to ASCII): MAP(chars, LAMBDA(c, CODE(UPPER(c)))) converts each character into its uppercase equivalent, then extracts its ASCII/ANSI decimal code.
    • The letter "A" (or "a") becomes 65.
    • The letter "Z" (or "z") becomes 90.
    • Numbers and special characters fall outside this 65–90 range (e.g., "1" is 49, "#" is 35).
  • FILTER (Keep Only Letters): The FILTER function evaluates each character. (codes >= 65) * (codes <= 90) acts as an AND condition, keeping only items with ASCII codes between 65 and 90. Adding + (chars = " ") acts as an OR condition to retain spaces.
  • CONCAT (Rebuild Text): Finally, the remaining filtered array elements are merged back into a single clean text string. If no letters are found, it safely returns an empty string ("").

Method 2: Using Power Query (Robust & Scalable)

For large datasets or recurring data imports, Power Query is the most efficient and robust tool. Power Query utilizes the Text.Select M-code function, which allows us to specify exactly which characters we want to retain.

Step-by-Step Power Query Guide

  1. Select your data table and go to the Data tab on the Excel Ribbon.
  2. Click From Sheet (or From Table/Range). This opens the Power Query Editor.
  3. Go to the Add Column tab and click Custom Column.
  4. Name your new column (e.g., Clean_Text).
  5. In the formula box, enter the following M code (replace [MyColumn] with your actual column name):
    Text.Select([MyColumn], {"a".."z", "A".."Z", " "})
    Note: The " " at the end of the list ensures spaces are preserved. If you want to strip spaces, remove it: {"a".."z", "A".."Z"}.
  6. Click OK.
  7. Go to the Home tab, click Close & Load, and load your cleaned data back into Excel.

Method 3: VBA User-Defined Function (Highly Flexible)

If you are working with older Excel versions (like Excel 2016 or 2019) that do not support dynamic arrays, a User-Defined Function (UDF) written in VBA is the cleanest alternative. By utilizing Regular Expressions (RegEx), we can target and remove non-alphabetic characters instantly.

The VBA Code

Press ALT + F11 to open the VBA editor, click Insert > Module, and paste the following code:

Function ExtractLetters(Cell As Range, Optional KeepSpaces As Boolean = True) As String
    Dim RegEx As Object
    Set RegEx = CreateObject("VBScript.RegExp")
    
    With RegEx
        .Global = True
        .IgnoreCase = True
        If KeepSpaces Then
            .Pattern = "[^a-zA-Z ]" ' Matches anything that is NOT a letter or a space
        Else
            .Pattern = "[^a-zA-Z]"  ' Matches anything that is NOT a letter
        End If
    End With
    
    If Not IsNull(Cell.Value) Then
        ExtractLetters = RegEx.Replace(Cell.Value, "")
    Else
        ExtractLetters = ""
    End If
End Function

How to Use the Custom VBA Function

Once you've pasted the code and saved your workbook as an Excel Macro-Enabled Workbook (.xlsm), you can use it just like a regular Excel formula:

  • To keep spaces: =ExtractLetters(A2) or =ExtractLetters(A2, TRUE)
  • To remove spaces: =ExtractLetters(A2, FALSE)

Method 4: Flash Fill (Instant, No-Formula Approach)

If this is a one-time cleaning task and you do not require dynamic formulas that update automatically, Excel's Flash Fill is the easiest option.

  1. Insert a new empty column next to your messy data.
  2. In the first row of the new column, manually type the cleaned text output you want to achieve. For example, if A2 contains "M4rty_McFl_y!", type "MartyMcFly" in B2.
  3. Press Enter to go to the next cell (B3).
  4. Press CTRL + E (or go to Data > Flash Fill).
  5. Excel will detect the pattern of removing numbers/special characters and automatically fill the rest of the column.

Advanced Tip: Handling International/Accented Characters

A common pitfall of standard ASCII-based solutions (like our Method 1 formula) is that they may accidentally exclude accented letters such as é, ö, à, ñ, or ç. These characters fall outside the classic 65-90 standard English alphabet range.

Updating the Excel 365 Formula for Accented Text

If your data includes international characters, we can switch from checking ASCII bounds to excluding specific character sets (numbers and common symbols) using their ASCII ranges:

=LET(
    chars, MID(A2, SEQUENCE(LEN(A2)), 1),
    codes, MAP(chars, LAMBDA(c, CODE(c))),
    CONCAT(FILTER(chars, 
        ISERR(MATCH(codes, {33..64, 91..96, 123..126, 128..191}, 0)), 
        ""
    ))
)

This exclusion-based logic filters out common special symbols (punctuation, currency signs, and numbers) while safely leaving international alphabetic characters intact.


Summary: Choosing the Right Tool

Method Best For Dynamic updates? Compatibility
Excel 365 Formula (LET) Daily work on modern Excel versions. No setup required. Yes Excel 365, Excel 2021+
Power Query Large enterprise datasets, system exports, structured pipelines. Yes (upon refresh) Excel 2010 and newer
VBA RegExp Custom Function Users on older Excel versions wanting custom spreadsheet functions. Yes All Excel versions (Desktop only)
Flash Fill Quick, one-off cleanup tasks. No Excel 2013 and newer

By implementing these methods, you can wave goodbye to messy strings. Whether you use the highly precise Excel 365 array formula, the scalability of Power Query, or the raw speed of Flash Fill, you now have the tools to transform any corrupted string into pristine, actionable data.

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.