Convert Text to Number

G

Guest

I have a string that is numbers and text that I need to "Extract" the
characters that need, as numbers. Then "CONVERT" them to numbers.

Example string: ABC1/2x5

I can "Extract" the 1/2, Now I need the "1/2" converted to .5
 
M

Max

Assuming it's always a single digit before and after the "/",
then this would suffice:

With the string in A1, try in B1:

=MID(A1,SEARCH("/",A1)-1,1)
/MID(A1,SEARCH("/",A1)+1,1)

(Hang around for better answers from others <g>)
 
M

Max

Another take on the post, focusing on the line:
I can "Extract" the 1/2, Now I need the "1/2" converted to .5

Assuming the extracted text string "1/2" is in A1,
try in B1:

=LEFT(A1,SEARCH("/",A1)-1)
/RIGHT(A1,LEN(A1)-SEARCH("/",A1))
 
G

Guest

Now, what if there is more than one "/".

Example: ABC1/2x5 1/2
Return 1/2 as .5000
 
M

Max

Now, what if there is more than one "/".

Example: ABC1/2x5 1/2
Return 1/2 as .5000

Assume you're referring to the 2nd instance of "1/2"
located after the space in the string

If A1 contains: ABC1/2x5 1/2

Try in B1:

=MID(A1,SEARCH(" ",A1)+1,
SEARCH("/",A1,SEARCH(" ",A1))-SEARCH(" ",A1)-1)
/ MID(A1,SEARCH("/",A1,SEARCH(" ",A1))+1,99)
 

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