Re: Exracting numerical data. by Biff
Biff
Fri Sep 08 15:32:41 CDT 2006
Based on your samples:
=--MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")),255)
A1 = All Schools 1634
The formula returns the numeric value: 1634
Copy down as needed.
Biff
"James Silverton" <not.jim.silverton@comcast.not> wrote in message
news:OK2ksK40GHA.4448@TK2MSFTNGP04.phx.gbl...
> "Bob Umlas" <Excel_Trickster@msn.com> wrote in message
> news:e1kk2Y30GHA.4976@TK2MSFTNGP02.phx.gbl...
>> Haven't seen your lst of numbers in text, but assuming it's something
>> like:
>> xxxxx765fffffff
>> jhgajshgdjhaghsdgas8888ygquwygduygquwygd
>> etc. and you want to extract the 765 and the 8888, then this set of
>> formulas
>> will do it.
>> Assuming your first # is in A1, enter this in B1 via ctrl/shift/enter:
>> =MID(A1,MATCH(FALSE,ISERROR(1*MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)),0),255)
>> and enter this in C1 via ctrl/shift/enter:
>> =1*MID(A1,MATCH(FALSE,ISERROR(1*MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)),0),MA
>> TCH(TRUE,ISERROR(1*MID(B1,ROW(INDIRECT("1:"&LEN(B1))),1)),0)-1)
>> fill these both down, and col C will contain the numeric portion.
>> HTH
>> Bob Umlas
>>
>> "James Silverton" <not.jim.silverton@comcast.not> wrote in message
>> news:O3HN2220GHA.3464@TK2MSFTNGP03.phx.gbl...
>>> Sorry, I recently mistakenly posted this to excel.charting.
>>>
>>> I recently had to extract the numerical data from text in
>>> the cells of a fairly long column. Since my problem was
>>> something I don't expect to have to do frequently, I simply
>>> copied the column to Word and used its wild-cards in Replace
>>> instead of Excel 2002's pitifully small list.
>>>
>>> I know there are available add-in user functions based on a loop
>>> and ISNUMBER but has anyone got a favorite method using built-in
>>> worksheet or formatting functions that might be better than the
>>> method I used?
>
> Thanks Bob! So it is possible and I admire your ingenuity but I'll bet I
> could copy into Word, replace characters by nothing and return about as
> fast as I could type in the equation and proof read it :-) Nonetheless, I
> am going to save your method in case this type of editing becomes more
> frequently necessary.
>
> Thanks also Biff but I don't like switching in and out of programs. I
> guess it is probably because I was once very accustomed to Unix and I
> could easily have done what I wanted there. Here is a small set of the
> sort of thing, which resulted from scanning and OCR of a newspaper
> article. The irregular spacing is for real.
>
> All Schools 1634
>
>
>
> Wheaton 1313
>
> Kennedy 1420
>
> Einstein 1459
>
> Watkins Mill 1468
>
> Gaithersburg 1498
>
> Rockville 1514
> --
> Jim Silverton
> Potomac, Maryland
>