View Single Post
  #4   Report Post  
MarcusA
 
Posts: n/a
Default Extrapolate numeric values from text string

How can I test for a numeric value in the first position of a text string?

"Harlan Grove" wrote:

Henrik wrote...
I need to extrapolate the numeric values from a list of text strings.
However, the numeric portion of each string is not consistent from
observation to observation. Does anyone have any idea about how to do this in
excel.

....
AB087623
numeric portion is
087623


You could do this with array formulas, specifically,

=LOOKUP(2,1/MID(x,MIN(FIND({0,1,2,3,4,5,6,7,8,9},x&"0123456789 ")),
ROW(INDIRECT("1:"&LEN(x)))),MID(x,MIN(FIND({0,1,2, 3,4,5,6,7,8,9},
x&"0123456789")),ROW(INDIRECT("1:"&LEN(x)))))

If you need to do this often, then I'd recommend that you download and
install Laurent Longre's MOREFUNC.XLL add-in from

http://xcell05.free.fr/english/

and use the REGEX.MID function it provides, e.g.,

=REGEX.MID(x,"\d+",1)