+ Reply to Thread
Results 1 to 6 of 6

Converting decimal inch to fractional inch

  1. #1
    Registered User
    Join Date
    10-24-2022
    Location
    US
    MS-Off Ver
    2016
    Posts
    3

    Converting decimal inch to fractional inch

    I have a program that takes an excel spreadsheet, reads in the values, and then makes a table out of the data. I work in decimal inch for all the spreadsheet calculations, but I need to convert the output to fractional inch. I currently take whatever number I wind up with, round it to the nearest .125, and then format the cell as a fraction up to two digits. This works as expected for any human reading the spreadsheet, but when the 3rd party program reads in the data it displays the underlying decimal number rather than the formatted fractional text.

    As a quick example: Say I do whatever math I need to do and the final result I get is 23.382 and it's in cell R6. I go to whatever the desired output cell is and enter "=MROUND(R6,.125)", and this gives me 23.375. All is well so far. Now I format the cell as "Fraction up to two digits" and it displays 23 3/8. Perfect. I save the file and import it into the 3rd party program. Instead of grabbing the 23 3/8 text it has taken in the underlying number of 23.375.

    My question is: How do I take a decimal number and actually convert it to fractional, not just format it as fractional? I can usually google my way out of these kinds of problems, but I am not having any luck accomplishing what I need to this time. I am sure some excel wizard has solved this 20 years ago, I just can't find it. I of course appreciate any help in advance.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Converting decimal inch to fractional inch

    It is simply formatting in Excel: the underlying number is a decimal (23.375) and it connot be converted into 23 3/8 as an internal representation.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    10-24-2022
    Location
    US
    MS-Off Ver
    2016
    Posts
    3

    Re: Converting decimal inch to fractional inch

    Ok, thank you.

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Converting decimal inch to fractional inch

    Hello awelton. Welcome to the forum.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.
    Dave

  5. #5
    Registered User
    Join Date
    10-24-2022
    Location
    US
    MS-Off Ver
    2016
    Posts
    3

    Re: Converting decimal inch to fractional inch

    Just in case this comes up in a google search one day I have some good followup news. I was able to accomplish this using some VBA functions made by a gentleman named Dan Ashby. I can't link because spam filter, but he is at engineerstoolkit.wordpress.com.
    There is one function that reads in a number in decimal feet and returns a string in fractional feet and inches (with or without superscript/subscript), and another function that takes a fractional foot and inch string and returns decimal feet.
    Since the first function is just building a string it ends up reading correctly even when formatted as "General", which is good enough for Autodesk inventor to read into a drawing table.

  6. #6
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,428

    Re: Converting decimal inch to fractional inch

    If you want generate the text "23 3/8", put 23.382 in A1 and please try
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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. [SOLVED] how to convert inch to mm and mm to inch using checkbox
    By noelcjf in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-26-2020, 01:44 AM
  2. [SOLVED] Convert Feet - Inch - Inch Fraction string into numerical value
    By plans in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-25-2017, 11:29 PM
  3. Converting feet & inch demensions to inch only in excell
    By sgmgrider in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-20-2015, 08:10 PM
  4. Decimal to feet/inch/fractional inch conversion
    By Rodney Sergent in forum Excel General
    Replies: 1
    Last Post: 08-10-2006, 10:50 PM
  5. [SOLVED] Professional engineering graph sheets 10 x 10/inch and 8 x 8/inch
    By Fugro-Karen in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-05-2006, 08:40 AM
  6. [SOLVED] formula for converting decimal to inch & fraction
    By davepatrob in forum Excel General
    Replies: 1
    Last Post: 12-31-2005, 11:15 AM
  7. [SOLVED] convert decimal to inch & fraction
    By davepatrob in forum Excel General
    Replies: 1
    Last Post: 12-31-2005, 01:10 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