How to get number from text?

J

JJ

I have data like these: 123ABC, 456EFG
Is there any way to return just number from those cells? How to do it? Thx.
 
O

oldchippy

JJ;221872 said:
I have data like these: 123ABC, 456EFG
Is there any way to return just number from those cells? How to do it
Thx.

If it just 3 numbers always to the left, then use

=LEFT(A1,3) or

=LEFT(A1,3)*1 to format it to a numbe
 
R

Rick Rothstein

Assuming the number is always in the beginning of the text...

=LOOKUP(9.9E+307,--LEFT(A1,ROW($1:$99)))

If the referenced cell could be blank, then use this...

=IF(A1="","",LOOKUP(9.9E+307,--LEFT(A1,ROW($1:$99))))

to suppress the error message when the referenced cell is empty.
 
S

Shane Devenshire

Hi,

If they are consistantly 3 numbers followed by 3 letters, you can
1. Choose the Data, Text to Columns command and follow the wizard
2. =--LEFT(A1,3)
 
R

Rick Rothstein

Just for clarification... the formula I posted will retrieve a numbers of varying number of digits from the front of the text. If, as others have pointed out, your data is always 3-digits long, then use the LEFT function to get it...

=--LEFT(A1,3)

where the double minus sign turns the text number returned by the LEFT function into a real number.

--
Rick (MVP - Excel)


Assuming the number is always in the beginning of the text...

=LOOKUP(9.9E+307,--LEFT(A1,ROW($1:$99)))

If the referenced cell could be blank, then use this...

=IF(A1="","",LOOKUP(9.9E+307,--LEFT(A1,ROW($1:$99))))

to suppress the error message when the referenced cell is empty.
 
Top