+ Reply to Thread
Results 1 to 11 of 11

How to have excel add/subtract fractions to satisfy given relationships

  1. #1
    Registered User
    Join Date
    07-31-2013
    Location
    Troy, MI
    MS-Off Ver
    Excel 2003
    Posts
    24

    How to have excel add/subtract fractions to satisfy given relationships

    I have a table (A14:I21) with data given in measurements of feet (A1=88.5542'). The values in that table are based on simple math relationships that I set. I then converted these values to feet-inches (see table K14:AA21) by separating the whole number and decimal portions (0.5542'*12 = 6.6504"). The decimal portion (6.6504") is formatted to show as a fraction to 1/16" accuracy (except for values in the Q column).

    I want excel to instead provide the fractions so that they STILL satisfy the math relationships I set. Since the fractions are rounded, it's not always adding up as I would like. In other words, I want excel to now treat the fractions as they are formatted, not their decimal values. For instance, C+F+G should equal A. If you look at Beam 6, however, this does not hold true.

    EDIT: I've attached the file.

    Any suggestions? Thanks in advance!
    Attached Files Attached Files
    Last edited by devpatel85; 08-21-2013 at 10:52 AM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How to have excel add/subtract fractions to satisfy given relationships

    To attach a spreadsheet, "Go Advanced" > manaage Attachments
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    07-31-2013
    Location
    Troy, MI
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: How to have excel add/subtract fractions to satisfy given relationships

    I attached the file. Can someone please help?

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: How to have excel add/subtract fractions to satisfy given relationships

    "In other words, I want excel to now treat the fractions as they are formatted, not their decimal values. For instance, C+F+G should equal A."

    Not sure I understand. The mathematics with the fractions as formatted is no less inaccurate, e.g. summing cells P20, Q20 ("C"), V20, W20 ("F"), X20, Y20 ("G") gives:

    (86+2+1)' + (9+0+8)" + ((7/8)+(8/16)+(6/16))"

    = 89'+17"+(28/16)" = 89'+1'5"+1 12/16" = 90' 6 3/4"

    which is not the same as the value in L20 and M20: 90' 6 13/16"

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  5. #5
    Registered User
    Join Date
    07-31-2013
    Location
    Troy, MI
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: How to have excel add/subtract fractions to satisfy given relationships

    That's what I mean, it's not the same value. I would like to have excel adjust the fractions as needed to satisfy the requirements. There are a few cases (Beam 6, C+F+G=/A) where excel has rounded a number up/down in the wrong direction, throwing off the result. The fractions have to work out exactly. As you can see, that second table is just converting the decimal feet values to feet-inch fractions. The formulas are not being applied to those values however. There has to be a way to make excel decide which fractions to adjust so that the equalities are met.

    Thanks

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: How to have excel add/subtract fractions to satisfy given relationships

    Yes, but each decimal must be rounded (to the nearest 1/16 in you case) on its own individual basis.

    How you would inform Excel that this degree of rounding must be amended subject to further (future) calculations with that value is not something I envisage being easy to do.

    Rather than keeping the actual decimal values and displaying them as fractions, in order to achieve what you wish you may have to devise a custom text format, though mathematical operations on those text values would have to be defined through formulae in each case.

    Is this something you would be willing to work with?

    Regards

  7. #7
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How to have excel add/subtract fractions to satisfy given relationships

    I suggest that when you are doing your math, use MROUND and (0.0625 assuming 1/16 is your smallest value not 1/32). For example in M15,

    =MROUND(12*(B15-INT(B15)),0.0625)
    then when you add cells, they will be exact multiples of 1/16. Does that help?

  8. #8
    Registered User
    Join Date
    07-31-2013
    Location
    Troy, MI
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: How to have excel add/subtract fractions to satisfy given relationships

    That does help ChemistB, and I think we're on the right track, but what now? I imagine I'll have to create another table that will handle the fractions and apply the operations. It's a bit tricky though. That second table is set up so that feet and inches are given in two separate columns. What function(s) can I use to combine the two while still being able to use the operations I give in table 3.

    I updated the worksheet (uses MROUND) and cleaned it up. Feel free to mess around with it and re-upload the file. Take a look at the functions

    I really appreciate the help guys.
    Attached Files Attached Files
    Last edited by devpatel85; 08-22-2013 at 12:11 PM.

  9. #9
    Registered User
    Join Date
    07-31-2013
    Location
    Troy, MI
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: How to have excel add/subtract fractions to satisfy given relationships

    I'm still looking for a function that can add/subtract feet-inches from two separate columns.

  10. #10
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How to have excel add/subtract fractions to satisfy given relationships

    In N18 for example

    =R18+X18+Z18+INT((S18+Y18+AA18)/12)

    In O18

    =MOD(S18+Y18+AA18,12)
    Does that work for you?

  11. #11
    Registered User
    Join Date
    07-31-2013
    Location
    Troy, MI
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: How to have excel add/subtract fractions to satisfy given relationships

    Thank you very much ChemistB! Really appreciate your help.

+ 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. Best way to represent relationships in excel
    By therealjag in forum Excel General
    Replies: 7
    Last Post: 10-21-2013, 04:10 PM
  2. Representing One to Many Relationships in Excel
    By andyiain in forum Excel General
    Replies: 3
    Last Post: 09-16-2012, 01:20 PM
  3. [SOLVED] can you create relationships in excel
    By Gillie in forum Excel General
    Replies: 2
    Last Post: 08-21-2006, 11:55 AM
  4. how to subtract whole #s but not fractions..
    By John Doe in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-13-2006, 06:50 AM
  5. Table relationships in Excel?
    By saturnius in forum Excel General
    Replies: 3
    Last Post: 01-26-2005, 08:06 PM

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