How to get number from text?

  • Thread starter Thread starter JJ
  • Start date Start date
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.
 
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.
 
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)
 
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.
 

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

Back
Top