+ Reply to Thread
Results 1 to 17 of 17

Formula to turn a Fraction to Decimal

  1. #1
    Registered User
    Join Date
    10-26-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    67

    Formula to turn a Fraction to Decimal

    Is there an easy formula to turn this formula in to decimal feet?

    1' - 1 11/16"

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

    Re: Formula to turn a Fraction to Decimal

    "Easy"? I don't know if it is "easy", but, you just need to extract the different parts from the text string and convert them to appropriate numbers.

    =VALUE(LEFT(text,1)) will return the 1 foot. The trick with extracting this will be knowing how many digits to return. Will the feet always be 1 digit? Can it be 2 digits? Do you need the formula to figure out how many digits for the feet part of the text string, or can you always trust that it will be however many digits (using leading zeros when needed)?

    =VALUE(MID(text,6,7)) will extract the 1.6875 inches. Again, the real difficulty is will this always be 7 characters long, or should it be 8 characters long to account for the 10 and 11 inch increments (and force you to enter as 01 11/16) or do you need the formula to figure out on the fly how many characters to extract?

    Of course, once you have the inches, you can convert to feet by dividing by twelve, then adding the initial feet number. =VALUE(LEFT(text,1)+VALUE(MID(text,6,7))/12 will convert that text string to 1.140625. From there, it's just a matter of knowing if that will always be the right way to parse the text string, or if you need the formula to figure out what to use for the 1, 6, and 7 parts of those text formulas. If this were my thing, and I assume that I will always be under 99 feet, I make the data entry step so that it will always be 2 digit feet and 2 digit inches and 2 digits for the fraction parts (aa' - bb cc/dd") with leading zeros when needed (your example would be entered as 01' - 01 11/16"), and use something like =VALUE(LEFT(text,2))+VALUE(MID(text(7,8))/12
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    10-26-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    67

    Re: Formula to turn a Fraction to Decimal

    it could be more than one digit. it could be 3 digits and possible 4, but for now I am dealing with 2 or 3 digits.

    What would the formula be if you had either of the following?

    1' - 1 11/16"
    10' - 1 11/16"
    100' - 1 11/16"
    1000' - 1 11/16"

    Thanks for your help. You have helped me before.

  4. #4
    Registered User
    Join Date
    10-26-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    67

    Re: Formula to turn a Fraction to Decimal

    I am trying to extract this from a string that is already provided simular to below.


    0' - 2 3/8"

    0' - 6 1/16"

    1' - 0 1/2"

    1' - 6 1/4"

    1' - 8 1/4"

    1' - 11 15/16"
    1' - 11 15/16"

    8' 5"

    2' - 1 11/16"
    2' - 1 11/16"

    2' - 1 15/16"
    2' - 1 15/16"
    2' - 1 15/16"

    2' - 7 3/4"

    2' - 11 3/8"
    2' - 11 3/8"

    2' - 11 15/16"
    2' - 11 15/16"

    3' - 1 1/8"

    3' - 11 3/4"

    4' - 0"

    4' - 0 9/16"

    6' - 5 1/2"

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

    Re: Formula to turn a Fraction to Decimal

    Are you understanding what the 1 and 2 are doing in the LEFT() function? The 6,7 and 7,8 in the MID() function? It should be the same function, just adjusting these parameters for the new text template. If you are not familiar with the LEFT() and MID() functions: https://support.office.com/en-us/art...6-1ea52b99640c and https://support.office.com/en-us/art...8-4ecb12433028
    The new text template would be aaaa' - bb cc/dd", and the new function would be =VALUE(LEFT(text,4))+VALUE(MID(text,9,8))/12

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

    Re: Formula to turn a Fraction to Decimal

    In a different direction, I would be inclined to do a text to columns to separate the feet from the inches, and, if I could do it at the same time, get rid of the apostrophe and quotation mark characters.

    So text to columns using - as the delimiter would get the feet and inches into separate columns. Something like VALUE(SUBSTITUTE(feet_text,"'","")) to get the feet number standing alone as a number. Then something like =VALUE(SUBSTITUTE(inches_text,CHAR(34),"")) to get the inches value alone as a number. Then a simple summation =feet_value+inches_value/12. Done that way, you end up with 5 additional columns (2 for the text to columns output, and 3 helper columns to convert the text to numbers and add them together). That might be the "easiest" way to do it.

    So much depends on what kind of solution you need.
    Last edited by MrShorty; 08-16-2018 at 04:45 PM.

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Formula to turn a Fraction to Decimal

    Give this one a try
    Enter formula in B1 and copy down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v A B
    1 0' - 2 3/8" 2.875
    2
    3 0' - 6 1/16" 3.8125
    4
    5 1' - 0 1/2" 1.5
    6
    7 1' - 6 1/4" 16.25
    8
    9 1' - 8 1/4" 21.25
    10
    11 1' - 11 15/16" 70.6875
    12 1' - 11 15/16" 70.6875
    13
    14 8' 5"
    15
    16 2' - 1 11/16" 8.9375
    17 2' - 1 11/16" 8.9375
    18
    19 2' - 1 15/16" 9.1875
    20 2' - 1 15/16" 9.1875
    21 2' - 1 15/16" 9.1875
    22
    23 2' - 7 3/4" 20.25
    24
    25 2' - 11 3/8" 16.125
    26 2' - 11 3/8" 16.125
    27
    28 2' - 11 15/16" 71.6875
    29 2' - 11 15/16" 71.6875
    30
    31 3' - 1 1/8" 4.375
    32
    33 3' - 11 3/4" 31.25
    34
    35 4' - 0"
    36
    37 4' - 0 9/16" 4.5625
    38
    39 6' - 5 1/2" 31.5
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  8. #8
    Registered User
    Join Date
    10-26-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    67

    Re: Formula to turn a Fraction to Decimal

    I understand what the 1 & 2 are doing, but I am struggling to get the info in the proper cells.

    the Dimension (1' - 0 1/2") is in Cell I1527. Can you help me with the proper formula?

    Sorry, I am just stupid to some of these things.

  9. #9
    Registered User
    Join Date
    10-26-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    67

    Re: Formula to turn a Fraction to Decimal

    This seems to work on everything except the ones where it does not have the 16ths. Is there something that could be added to take care of this?

  10. #10
    Registered User
    Join Date
    10-26-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    67

    Re: Formula to turn a Fraction to Decimal

    Actually, it is not working in every case. Look at the last one you sent, it is coming out to 31.5 for 6' - 5 1/2".

  11. #11
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Formula to turn a Fraction to Decimal

    See if this one will give you better results
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v A B
    1 0' - 2 3/8" 2.375
    2 1' - 1 11/16" 13.6875
    3 0' - 6 1/16" 6.0625
    4
    5 1' - 0 1/2" 12.5
    6
    7 1' - 6 1/4" 18.25
    8
    9 1' - 8 1/4" 20.25
    10
    11 1' - 11 15/16" 23.9375
    12 1' - 11 15/16" 23.9375
    13
    14 8' 5"
    15
    16 2' - 1 11/16" 25.6875
    17 2' - 1 11/16" 25.6875
    18
    19 2' - 1 15/16" 25.9375
    20 2' - 1 15/16" 25.9375
    21 2' - 1 15/16" 25.9375
    22
    23 2' - 7 3/4" 31.75
    24
    25 2' - 11 3/8" 35.375
    26 2' - 11 3/8" 35.375
    27
    28 2' - 11 15/16" 35.9375
    29 2' - 11 15/16" 35.9375
    30
    31 3' - 1 1/8" 37.125
    32
    33 3' - 11 3/4" 47.75
    34
    35 4' - 0" 48
    36
    37 4' - 0 9/16" 48.5625
    38
    39 6' - 5 1/2" 77.5

  12. #12
    Registered User
    Join Date
    10-26-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    67

    Re: Formula to turn a Fraction to Decimal

    Everything seems to work great except when I come to a dimension like the following

    1' - 7" This returns a value of 5.

    Can you also provide a solution for this instance?

    Thank you very much for your help.

  13. #13
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Formula to turn a Fraction to Decimal

    There are some of them that can't be resolved like: 1' - 7" or 8' 5" At least I couldn't find a solution for them yet.

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

    Re: Formula to turn a Fraction to Decimal

    The solution I proposed in post #6 (text to columns followed by a couple of substitute() formulas) works for those cases -- it just doesn't all fit into a single cell.

    Would that work, or must it be a single cell mega formula?

  15. #15
    Registered User
    Join Date
    10-26-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    67

    Re: Formula to turn a Fraction to Decimal

    Thank you for your help.

  16. #16
    Registered User
    Join Date
    10-26-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    67

    Re: Formula to turn a Fraction to Decimal

    I would prefer one formula, but I have no clue how to write it. Thank you for all of your help.

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

    Re: Formula to turn a Fraction to Decimal

    Then I guess (at least for me) that the answer to the OP question is "No, there is not an easy function."

    I haven't got time to piece a complete function together, but I could see adding the FIND() function to these text functions to help separate feet from inches https://support.office.com/en-us/art...3-d0d89b0a0628

    LEFT(text,FIND("'",text)-1) should return the feet number.
    Something like MID(text,FIND("-",text)+2,FIND(CHAR(34),text)-FIND("-",text)-2) should find the inches number.
    Then, those two variations of LEFT() and MID() fit into the summation like above =VALUE(LEFT(...))+VALUE(MID(...))/12
    I haven't got time right now to test and fine tune those FIND() functions to make sure the correct stuff will always be returned, but one should be able to coax something like that to give you the result you want.

+ 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. Decimal fraction
    By gfell153 in forum Excel General
    Replies: 12
    Last Post: 01-29-2018, 07:51 AM
  2. [SOLVED] Formula needed to return fraction as a decimal
    By gko_87 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-14-2016, 01:45 AM
  3. [SOLVED] Turn a fraction around, then show it as a decimal
    By tom hatten in forum Excel General
    Replies: 5
    Last Post: 01-17-2016, 01:22 PM
  4. decimal to fraction
    By itselflearn in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-06-2015, 11:04 AM
  5. [SOLVED] Fraction to Decimal
    By Michael D in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-13-2013, 03:21 PM
  6. [SOLVED] How do I turn a fraction into a decimal?
    By ad9051 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 02-04-2013, 01:04 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

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