Extract the Numeric Characters from a Text String

Extracting the Numeric Characters from a Text String

The following formula extracts the numeric characters from the text string in A2...

=TEXT(SUM(MID(0&A2,LARGE(IF(ISNUMBER(MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1)+0),
ROW(INDIRECT("1:"&LEN(A2))),0),ROW(INDIRECT("1:"&LEN(A2))))+1,1)*
10^ROW(INDIRECT("1:"&LEN(A2)))/10),REPT(0,SUM(IF(ISNUMBER(MID(A2,
ROW(INDIRECT("1:"&LEN(A2))),1)+0),1))))

Note that the formula needs to be confirmed with CONTROL+SHIFT+ENTER. If done correctly, Excel will automatically place curly braces {...} around the formula.

Based on the sample data, the formula returns "028".

Sample Workbook: Download