I need to get all the fractions in column "C" to a decimal number for it to be able to read into another program. Column "P-R" is my attempt at doing so. I am then trying to add Q+R but excel is still reading "R" as a date and adds to zero.
I need to get all the fractions in column "C" to a decimal number for it to be able to read into another program. Column "P-R" is my attempt at doing so. I am then trying to add Q+R but excel is still reading "R" as a date and adds to zero.
I forgot to mention that Columns "C-M" are copied and pasted from online, so I am trying to avoid manipulating them in any way possible.
Any help is appreciated.
Building on your work so far, in cell S2, use:
Cheers,![]()
Please Login or Register to view this content.
Would you like to say thanks? Please click the: "Add Reputation" button, on the grey bar below the post.
I would tend towards using the VALUE() function, recognizing that Excel can automatically detect fractions/mixed numbers as long as they are in the form x xx/xx. If I can coax the text to be in that format, then Excel will convert to number. I tried something like
=IF( -- outer IF() function
OR( -- two cases to test: mixed number or integer inch
LEN(C2)=2, -- to capture the integer inch cases Excel can automatically convert to number
MID(C2,2,1)=" "), -- to capture the mixed number cases Excel can automatically convert to number
VALUE(LEFT(C2,LEN(C2)-1)), -- extract the mixed number/integer without the quote and convert to number
VALUE(CONCATENATE("0 ",LEFT(C2,LEN(C2)-1)))) -- Extract the fraction without quote, tack "0 " onto the front of it, and convert to a number.
It is certainly not the only way to do it, but that's probably how I would do it (without changing the input data).
Originally Posted by shg
I believe I may have stumbled upon a grand formula that takes care of non-fractions (i.e. regular integers and decimals...even negatives), compound fractions with spaces, and/or compound fractions with dashes (-):
=IF(OR(LEN(B2)=1,MID(B2,2,1)=" ",ISNUMBER(B2)),VALUE(LEFT(B2,LEN(B2))),IFERROR(VALUE(CONCATENATE("0 ",LEFT(B2,LEN(B2)))),0+TRIM(SUBSTITUTE(B2,"-"," "))))
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks