Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • How to Create One and Two Variable Data Tables in Excel
  • Use Data Form to input, edit and delete records in Excel
  • Conflicting Multiple Conditional Formatting Rules in Excel
  • How to combine 2 or more chart types in a single chart in Excel
  • How to count table columns in Excel

References

  • INDEX function: Description, Usage, Syntax, Examples and Explanation
  • Excel Advanced Lookup using Index and Match Functions
  • Count unique text values with criteria
  • Create hyperlink with VLOOKUP in Excel
  • How to use Excel VLOOKUP Function

Data Validations

  • How To Create Drop-down List in Excel
  • Excel Data validation allow weekday only
  • Prevent invalid data entering in specific cells
  • Excel Data validation must begin with
  • Excel Data validation must not contain

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.

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.

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:

{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

Next Post:

Create One-dimensional and Two-dimensional Array

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

Logical Functions

  • SWITCH function: Description, Usage, Syntax, Examples and Explanation
  • XOR function: Description, Usage, Syntax, Examples and Explanation
  • IFNA function: Description, Usage, Syntax, Examples and Explanation
  • NOT function: Description, Usage, Syntax, Examples and Explanation
  • How to return blank in place of #DIV/0! error in Excel

Date Time

  • Sum race time splits in Excel
  • How to get same date next month or previous month in Excel
  • Calculate total hours that fall between two times in Excel
  • Convert text to date in Excel
  • How to get Holiday Date from Year in Excel

Grouping

  • How to randomly assign data to groups in Excel
  • Group numbers with VLOOKUP in Excel
  • Group times into unequal buckets in Excel
  • Calculate conditional mode with criteria in Excel
  • Group times into 3 hour buckets in Excel

General

  • Find, Trace and Correct Errors in Excel Formulas using ‘Formula Auditing’
  • How to calculate total from percentage in Excel
  • Lock Cells in a Worksheet Excel
  • How to get amount with percentage in Excel
  • Count cells that do not contain errors in Excel
© 2025 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning