how to extract numbers from imported cell with text and numbers?

G

Guest

does anyone know how to extract the number from an imported cell if the cell
contains both text and numbers?
eg. the cell contains "USD 30.79 (March 27, 2007)" but i want to use only
30.79 in a formula in another cell
 
R

Ron Rosenfeld

does anyone know how to extract the number from an imported cell if the cell
contains both text and numbers?
eg. the cell contains "USD 30.79 (March 27, 2007)" but i want to use only
30.79 in a formula in another cell

It depends on your format.

If your format is like the above, where the number to be extracted is always
the first "number value" in the string, then:

=LOOKUP(9.99999999999999E+307,--MID(
A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1
&"0123456789")),ROW(INDIRECT("1:"&LEN(A1)))))

will do what you want.

If your format variations are more complex, then you will need to post more
information.
--ron
 
G

Guest

thanks mike! :)

unfortunately, i forgot to add that i need the data to keep refreshing every
hour. i tried using 'text to columns' but after splitting, cells are removed
from the imported data and cannot be refreshed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top