I am trying to extract numbers, some of which are fractions, from a text string to use in calculating the weight of the material in a list.
Example from cell D14: Bar 4x1/4
I was able to extract the "4" with =VALUE(MID(D14,SEARCH(" ",D14,1)+1,(SEARCH("X",D14,1))-(SEARCH(" ",D14,1)+1))) but I used =VALUE(CLEAN(RIGHT(D14,(LEN(D14)-(SEARCH("X",D14,1)))))) without the "VALUE" function to get the "1/4" which was great but when I add the "VALUE" function I get "42008" as the value not ".25" as expected. The "CLEAN" function was added only in an effort to get rid of any extra characters that may be causing the value to come out wrong. I had also tried "TRIM" for the same purpose.
The puzzling part is that I was able to extract a fraction when it was with a whole number and use it in a calculation.
Example from cell D17: BAR 1 1/2x3/8
I used =VALUE(MID(D17,SEARCH(" ",D17,1)+1,(SEARCH("X",D17,1))-(SEARCH(" ",D17,1)+1))) to turn the "1 1/2" into a workable number. Worked great for "1 1/2"! I had also tried the "MID" function to extract the "1/4" and was successful but when I added the "VALUE" function I got the same "42008" value. What am I doing wrong or what function do I need to add to make "1/4" a workable number?
Example from cell D14: Bar 4x1/4
I was able to extract the "4" with =VALUE(MID(D14,SEARCH(" ",D14,1)+1,(SEARCH("X",D14,1))-(SEARCH(" ",D14,1)+1))) but I used =VALUE(CLEAN(RIGHT(D14,(LEN(D14)-(SEARCH("X",D14,1)))))) without the "VALUE" function to get the "1/4" which was great but when I add the "VALUE" function I get "42008" as the value not ".25" as expected. The "CLEAN" function was added only in an effort to get rid of any extra characters that may be causing the value to come out wrong. I had also tried "TRIM" for the same purpose.
The puzzling part is that I was able to extract a fraction when it was with a whole number and use it in a calculation.
Example from cell D17: BAR 1 1/2x3/8
I used =VALUE(MID(D17,SEARCH(" ",D17,1)+1,(SEARCH("X",D17,1))-(SEARCH(" ",D17,1)+1))) to turn the "1 1/2" into a workable number. Worked great for "1 1/2"! I had also tried the "MID" function to extract the "1/4" and was successful but when I added the "VALUE" function I got the same "42008" value. What am I doing wrong or what function do I need to add to make "1/4" a workable number?