+ Reply to Thread
Results 1 to 5 of 5

Problems converting fraction as a text cell to a decimal

  1. #1
    Registered User
    Join Date
    05-24-2017
    Location
    America
    MS-Off Ver
    2010
    Posts
    2

    Question Problems converting fraction as a text cell to a decimal

    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.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    05-24-2017
    Location
    America
    MS-Off Ver
    2010
    Posts
    2

    Re: Problems converting fraction as a text cell to a decimal

    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.

  3. #3
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Problems converting fraction as a text cell to a decimal

    Building on your work so far, in cell S2, use:

    Please Login or Register  to view this content.
    Cheers,
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Problems converting fraction as a text cell to a decimal

    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).
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Registered User
    Join Date
    05-04-2016
    Location
    Alberta, Canada
    MS-Off Ver
    Home and Business 2013
    Posts
    4

    Re: Problems converting fraction as a text cell to a decimal

    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,"-"," "))))

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Converting Decimal to Fraction Text VBA
    By vbalearnerSF in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-27-2014, 02:38 PM
  2. Replies: 6
    Last Post: 07-01-2014, 03:23 AM
  3. Replacing Fraction to decimal it is not converting
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-17-2014, 03:16 AM
  4. this tool for converting to fraction to decimal it is not running properly
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-07-2014, 10:46 AM
  5. Converting decimal into a fraction via vba
    By pooky in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-28-2013, 08:32 PM
  6. Still having problems with converting h:m to decimal
    By andyb_work in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-08-2008, 04:01 PM
  7. [SOLVED] formula for converting decimal to inch & fraction
    By davepatrob in forum Excel General
    Replies: 1
    Last Post: 12-31-2005, 11:15 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1