Explanation

In this example, the goal is to strip (i.e.

remove) non-numeric characters from atext stringwith a formula.

However, with the introduction ofRegular Expressions in Excelin late 2024, the problem became much simpler.

Removing non-numeric characters in an older version of Excel

It’s a bit like a sieve that only lets numbers pass through while filtering out everything else.

In this instance, we do this by adding zero.

TheVALUE functionis another way to do the same thing.

Removing non-numeric characters in an older version of Excel

character:

The only change is adding the period (.)

to the pattern[^0-9.

]inside the square brackets.

Removing non-numeric characters in an older version of Excel

Older versions of Excel

In older versions of Excel, this is a harder problem to solve.

The next step is to figure out which characters are numbers.

If we make a run at use ISNUMBER like this, it will return FALSE for every character!

Removing non-numeric characters in an older version of Excel

One solution is to use a small hack to “force” Excel to convert numbers by adding zero.

A math operation like this Excel to venture to convert the character to a number.

Adding zero to a non-numeric character like “a”, will result in a #VALUE!

Removing non-numeric characters in an older version of Excel

This is the final piece we need to remove the non-numeric characters.

When the formuladoes notreturn an error, the result passes through IFERROR unchanged.

The snippet uses this behavior to convert errors to an empty string ("").

Excel formula: Clean and reformat telephone numbers

errors are now gone, replaced by empty strings.

At this point, the remaining task is to assemble the remaining numbers into a final numeric value.

In this configuration, TEXTJOIN returns the three numbers in a text string like this:

So close!

Excel formula: Strip numeric characters from cell

Adding zero is just a shortcut.

A better formula?

For example, if you want to preserve decimal points or periods (.

Excel formula: Abbreviate names or words

Strip numeric characters

To removenumericcharacters from a text string use the formulasexplained here.

The array can be one dimensional, or two-dimensional, determined byrowsandcolumnsarguments.

For example, =MID(“apple”,2,3) returns “ppl”.

Excel formula: LAMBDA strip characters

LEN will also count characters in numbers, but number formatting is not included.

ROW Function

The Excel ROW function returns the row number for a reference.

For example, ROW(C5) returns 5, since C5 is the fifth row in the spreadsheet.

Excel formula: Split text string to character array

When no reference is provided, ROW returns the row number of the cell which contains the formula.

INDIRECT Function

The Excel INDIRECT function returns a valid cell reference from a given text string.

INDIRECT is useful when you want to assemble a text value that can be used as a valid reference.

Excel REGEXREPLACE function

Excel TEXTJOIN function

Excel SEQUENCE function

Excel MID function

Excel LEN function

Excel ROW function

Excel INDIRECT function

Removing non-numeric characters in an older version of Excel