Skip to content
xlsoffice. All Rights Reserved
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Lookup and Reference Examples

  • Count rows with at least n matching values
  • How to get relative column numbers in a range in Excel
  • How to use Excel INDIRECT Function
  • How to use Excel MMULT Function
  • Count unique text values with criteria

Data Analysis Examples

  • How to calculate correlation coefficient Correlation in Excel
  • How To Insert and Customize Sparklines in Excel
  • Everything about Charts in Excel
  • How to Create Gantt Chart in Excel
  • How to add Trendline to a chart in Excel

Data Validation Examples

  • Excel Data validation with conditional list
  • Excel Data validation date in specific year
  • Excel Data validation require unique number
  • Excel Data validation only dates between
  • Excel Data validation no punctuation

How to strip non-numeric characters in Excel

by

To remove non-numeric characters from a text string, you can try this experimental formula based on the TEXTJOIN function, new in Excel 2016.

Formula

{=TEXTJOIN("",TRUE,IFERROR(MID(A1,ROW
(INDIRECT("1:100")),1)+0,""))}

Note: TEXTJOIN will return the numbers as text, for example “100,”500″, etc. If you want a true numeric result, add zero, or wrap the entire formula in the VALUE function. TEXTJOIN was added in Excel 2016 + Office 365.

Explanation

In the example shown, the formula in C5 is:

{=TEXTJOIN("",TRUE,IFERROR(MID(B5,ROW
(INDIRECT("1:100")),1)+0,""))}

Note: this is an array formula and must be entered with control + shift + enter.

Worked Example:   How to use Excel TRUE Function

How this formula works

Working from the inside out, the MID formula is used to extract the text in B5, one character at a time.  The key is the ROW/INDIRECT piece:

ROW(INDIRECT("1:100"))

which spins up an array containing 100 numbers like this:

{1,2,3,4,5,6,7,8….99,100}

Note: 100 represents the maximum characters to process. Change to suit your data.

Worked Example:   How to strip numeric characters from cell in Excel

This array goes into the MID function as the start_num argument. For num_chars, we use 1.

The MID function returns an array like this:

{“1″;”0″;”0″;” “;”a”;”p”;”p”;”l”;”e”;”s”;””;””;””;””…}

(extra items in the array removed for readability)

To this array, we add zero. This is a simple trick that forces Excel to try and coerce text to a number. Numeric text values like “1”,”2″,”3″,”4″ etc. are converted, while non-numeric values fail and throw a #VALUE error. We use the IFERROR function to catch these errors and return an empty string, while numeric values pass through into the array. The result is an array that contains just numbers and empty strings:

Worked Example:   Convert text string to valid reference in Excel using Indirect function

{1;0;0;””;””;””;””;””;….}

Finally, this array result goes into the TEXTJOIN function as the text1 argument. For delimiter, we use an empty string (“”) and for ignore_empty we supply TRUE. TEXTJOIN then concatenates all non-empty values in the array and returns the result.

Post navigation

Previous Post:

How to strip numeric characters from cell in Excel

Next Post:

How to strip html from text or numbers in Excel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others
  • How to get page from URL in Excel
  • Join Text Strings Using Concatenate or ‘& Operator’ in Excel
  • T function: Description, Usage, Syntax, Examples and Explanation
  • UPPER function: Description, Usage, Syntax, Examples and Explanation
  • How to compare two text strings in Excel
  • Add workdays no weekends in Excel
  • Find Last Day of the Month in Excel
  • Convert decimal seconds to Excel time
  • Display Days in month in Excel
  • Get last day of month in Excel
  • NPER function: Description, Usage, Syntax, Examples and Explanation
  • DDB function: Description, Usage, Syntax, Examples and Explanation
  • ACCRINTM function: Description, Usage, Syntax, Examples and Explanation
  • Example of Future value of annuity in Excel
  • SLN function: Description, Usage, Syntax, Examples and Explanation
Acronyms, Abbreviations, Initialism & What They Stand For
© 2022 xlsoffice . All Right Reserved. | Teal Smiles