+ Reply to Thread
Results 1 to 7 of 7

Displaying fractions of an inch to the nearest 1/16

  1. #1
    Forum Contributor
    Join Date
    04-01-2019
    Location
    USA Ohio, Fremont
    MS-Off Ver
    Office 365
    Posts
    135

    Question Displaying fractions of an inch to the nearest 1/16

    I have a spreadsheet which sums dimensions in the FIF Format – Feet, Inches, and Fraction. The fractions are in multiples of sixteens of an inch. The feet, inches, numerator, and denominator are all separate values in separate columns. The feet value is converted to inches and added to the inches value and then to the decimal value of the fraction (numerator/denominator) to arrive at decimal value in inches for the dimension. A running decimal total for the dimensions added is calculated. I am converting this running decimal dimension total back to the FIF Format. However, I want the fraction (decimal or mantissa portion of the RT dimension) to be in sixteens and have the lowest common denominator. For example: 4/16 would be represented as 1/4, 2/16 as 1/8 etc.

    I have toyed with various ways of doing this but in researching on the internet I discovered the MROUND function. I set up a simple spread sheet to test Function using the method they showed as illustrated below in column E.

    A
    B
    C
    D
    E
    1
    0
    16
    0
    0/1
    0/1
    2
    1
    16
    0.0625
    1/16
    1/16
    3
    2
    16
    0.125
    1/8
    1/8
    4
    3
    16
    0.1875
    3/16
    3/16
    5
    4
    16
    0.25
    1/4
    1/4
    6
    5
    16
    0.3125
    5/16
    5/16
    7
    6
    16
    0.375
    3/8
    3/8
    8
    7
    16
    0.4375
    7/16
    7/16
    9
    8
    16
    0.5
    1/2
    1/2
    10
    9
    16
    0.5625
    9/16
    9/16
    11
    10
    16
    0.625
    5/8
    5/8
    12
    11
    16
    0.6875
    11/16
    11/16
    13
    12
    16
    0.75
    3/4
    3/4
    14
    13
    16
    0.8125
    13/16
    13/16
    15
    14
    16
    0.875
    7/8
    7/8
    16
    15
    16
    0.9375
    15/16
    15/16
    The fourth column D has the formula =C1-INT(C1) with custom formatting for number ##/##.
    The fifth column E has the formula =MROUND(C1,1/16) with custom formatting for number ##/##.

    Both, of these seem to work for showing the lowest common denominator fraction. I am not sure why? ANY THOUGHTS!!

    It, sure beats Visual Basic Programing to achieve this result. I am trying to learn VBA at the present time.
    Last edited by 6StringJazzer; 02-26-2020 at 11:17 PM. Reason: Title, data format

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2407
    Posts
    26,153

    Re: Baffled

    Welcome to the Forum TINHAMMER!

    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #1 requires good titles. "Baffled" is not a good title. I have updated it for you this time because you are a new member.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    04-01-2019
    Location
    USA Ohio, Fremont
    MS-Off Ver
    Office 365
    Posts
    135

    Re: Baffled

    Thank you!

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2407
    Posts
    26,153

    Re: Displaying fractions of an inch to the nearest 1/16

    This may be the first question in history that asks why something works instead of why it doesn't work.

    I don't know how you got your data in C but that data is already a fraction rounded to the nearest 1/16 (0.0625). If you apply the ##/## format to column C, you will get exactly the same display that you get in D and E.

    When you use the formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    it has no effect since INT(C1) is going to be 0 for all those values. Therefore when you format it as a fraction, Excel automatically formats to a simplified fraction, giving the results you see.

    MROUND rounds the numbers in C to the nearest 1/16, but those numbers are already rounded to the nearest 1/16 so it has no effect.

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,633

    Re: Displaying fractions of an inch to the nearest 1/16

    Not sure what you expected, maybe number displayed as #/16 ?
    Format cell as follow
    Attached Images Attached Images
    Quang PT

  6. #6
    Forum Contributor
    Join Date
    04-01-2019
    Location
    USA Ohio, Fremont
    MS-Off Ver
    Office 365
    Posts
    135

    Re: Displaying fractions of an inch to the nearest 1/16

    Thank you for your HELP. Now I understand how it works. I didn't realize the Custom Formatting ##/## would result in the Lowest Common Denominator in Sixteens if the decimal value is an exact multiple of 1/16s decimals. I am assuming this will work for other units as well 32nds, 64ths, etc. I will give it a try.

    I wonder if this works in other Microsoft software like Access I will have to try this also, could eliminate some serious coding or VBA work.

    To answer your question Column C is just Column A divided by Column B (always 16) this is just a simple test table to make sure my LCD - Lowest Common Denominator gave the correct result.

    Boy! do I like learning something NEW - especially when you are a Senior Citizen.

    Again many thanks for your help.!!!

  7. #7
    Forum Contributor
    Join Date
    04-01-2019
    Location
    USA Ohio, Fremont
    MS-Off Ver
    Office 365
    Posts
    135

    Re: Displaying fractions of an inch to the nearest 1/16

    Thanks, I tried this but it doesn't give me the lowest common denominator fraction - it gives me everything over 16.

    The formatting fraction for fraction up to two digits does work, it gives me the same results as custom formatting ##/##.

    By your suggestion I did learn of the 16ths fraction I hadn't noticed that before. Thank you.

+ 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. Writing an expression - BAFFLED
    By cfish2008 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-03-2017, 05:07 AM
  2. [SOLVED] Baffled why formula wont work
    By dougmorgan in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-25-2016, 11:25 AM
  3. Baffled by countif #Value error
    By Groovicles in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-23-2015, 01:30 PM
  4. COUNTIFS Problem has got me baffled...Please Help!
    By ogbugsy in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-23-2013, 10:47 AM
  5. Baffled by SumIf issue.
    By MLocke in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-02-2013, 03:31 PM
  6. [SOLVED] Excel 2007 : Baffled by the (lack of) result of a countif
    By neil40 in forum Excel General
    Replies: 1
    Last Post: 04-01-2012, 06:43 AM
  7. Strange Vlookup result - baffled
    By andycaps in forum Excel General
    Replies: 9
    Last Post: 01-18-2012, 08:58 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