fractions to decimal

A

Alvin

I want to have one cell call a cell that has a fraction in it that is
formated like so
0'-7/8"
I need it to be formated like
0'-0 7/8" so with the following code I can convert it to decimal.

[=SUBSTITUTE(LEFT(H69,FIND("-",H69)-1),"'","")*12+SUBSTITUTE(REPLACE(H69,1,FIND("-",H69),""),"""","")]

the above code works when it is formated correctly

Please help
Thanks in advance
 
K

ker_01

Is this a custom cell format, or just content stored as the text default?

if text, why not just search/replace "-" with "- 0 "

Or if you have mixed cells (you didn't provide much detail), use code to
find cells where [logic, not code] =Len
((find("/",string))-(find("-",string)))< 3
and just replace in those cells

HTH
Keith
 

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