xl-central.com, Your Quick Reference to Excel Solutions





navleft
navright
spacer

Extract Numeric Characters from a Text String

Extract Numeric Characters from a Text String

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

=SUM(MID(0&B2,LARGE(ISNUMBER(--MID(B2,ROW(INDIRECT("1:"&LEN(B2))),1))*ROW(INDIRECT("1:"&LEN(B2))),
ROW(INDIRECT("1:"&LEN(B2))))+1,1)*10^ROW(INDIRECT("1:"&LEN(B2)))/10)

Note that this is an array formula, which needs to be confirmed with CONTROL+SHIFT+ENTER for the PC or COMMAND+RETURN for the Mac.

Based on the sample data, the formula returns "123456".  Sample Workbook





spacer
Wu Yi Tea
Website Designed by Wu Yi Tea
Design downloaded from free website templates.
Wordpress Themes