+ Reply to Thread
Results 1 to 16 of 16

Force a list that has rounding issues to equal a set amount

  1. #1
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    2007
    Posts
    35

    Force a list that has rounding issues to equal a set amount

    Hi folks,

    I was pleasantly surprised to see some quick responses to my last post and I hope the community doesn't mind if I ask for help with a second issue.
    I am often given amounts from a set of accounts and then a separate breakdown of expenses. The total of these expenses must equal the amount given in the accounts, regardless of whether the figure is correct or not (it is a matter of materiality and also client-introduced rounding errors etc). As such I would greatly appreciate a formula that takes the figure I need as correct, adds or reduces the last expense in the list by 1 and then leaves me with a total that agrees which I could then tap into a calculator and know the list adds up to the correct amount. I have gone into detail on the sheet below and I imagine there is a simple way of fixing this, I am just unaware of it. Thank you very much!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Force a list that has rounding issues to equal a set amount

    A little bit confused about what you are asking, so I am guessing the solution. Is this what you are after?

    =IF($C$3>SUM(O3:O6),$C$3-SUM(O3:O6),IF($C$3<SUM(O3:O5), $C$3+SUM(O3:O6),0))?

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Force a list that has rounding issues to equal a set amount

    why cant you just set the format of the total to display no decimal places?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    2007
    Posts
    35

    Re: Force a list that has rounding issues to equal a set amount

    Hi JieJenn,

    Thanks for the quick reply! I presume that formula should go in my total section. Unfortunately it produces the number 43 which isn't right. The two conditions of this are that the expense list should add up (by hand/calculator) to 316 (C3) and that the total should also equal 316.

    If the list doesn't add up properly because of rounding issues etc then I would like one of the expenses, in this case the last, to be altered so that the total is the correct amount, the same as C3.

    Hope you don't mind revisiting that and finding what needs changing for me - thank you

  5. #5
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    2007
    Posts
    35

    Re: Force a list that has rounding issues to equal a set amount

    Hi FDibbins,

    Thanks for your suggestion - the problem there is that when I've tried that it produces a rounded amount again that is incorrect. In my example, scenario 1 - the total amount is correct but the list doesn't actually add up properly. In scenario 2, the same numbers (without any rounded decimals in exp 1+2) add up to 315. So you can see that the numbers are off due to rounding and I can't change the format in which they are expressed (that would be too easy!) :D

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Force a list that has rounding issues to equal a set amount

    I was looking at something like that too, that formula would have to go into a helper column. it cannot go where the 43 is, nor can it go where the total is. so maybe the best thing would be to add a helper column that references all the values, and then just use JJ's formula in the last cell of the helper, then sum the helper

  7. #7
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    2007
    Posts
    35

    Re: Force a list that has rounding issues to equal a set amount

    Well I'm glad you don't think it's impossible! Unfortunately I don't know how to set up what you have just said, would it be too much to ask you to attach the fixed file? If you can do this then I will be over the moon!

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Force a list that has rounding issues to equal a set amount

    its really easy. in a blank column next to your data (say, column P), in P3, just type in =O3. copy that down as far as you need, then in the last cell, use JJ's formula. then where you have your current total, replace that with =SUM(P3:P7)

  9. #9
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    2007
    Posts
    35

    Re: Force a list that has rounding issues to equal a set amount

    Hi FDibbins, I've tried what you said and unfortunately it still doesn't do what I need it to. It just still gives me 316 and doesn't change the last figure so it adds up manually I blame the rounding again! Is there any other way that you can think of getting this to work? I'm starting to think that you might have been right in the first place with your suggestion about formatting - is it possible to get the total to only take into account the numbers that I can see, not the hidden decimals? So grateful for your help and happy new year! :D

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Force a list that has rounding issues to equal a set amount

    Please Login or Register  to view this content.
    The formula in C4 and copied down is

    =IF(B4=0, 0, ROUND(B4 * ($C$2 - SUM(C$3:C3) ) / ($B$2 - SUM(B$3:B3)), 0))
    Entia non sunt multiplicanda sine necessitate

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Force a list that has rounding issues to equal a set amount

    Hi FDibbins, I've tried what you said and unfortunately it still doesn't do what I need it to. It just still gives me 316
    Thats what you said you wanted?

    see the attached
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    2007
    Posts
    35

    Re: Force a list that has rounding issues to equal a set amount

    Firstly, thank you both for your responses
    Secondly, FDibbins, you're spot on that I want it to be 316, it's just that I'm restricted to not using decimal places when I present this information so unfortunately I can't use your solution as it stands without rounding up that last figure (which would change the total if I didn't have that helper column - as is likely given that I need this formula to work on client-facing documents).

    I can see that both you and Shg have done the best thing which is to find the missing amount to get me to 316 but annoyingly I just can't use the decimals. Is there a way to use a SUM function that only takes into account integers and not decimals? That would sort this all out and I wouldn't need a helper column.

    I am incredibly grateful for your continued help

  13. #13
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    2007
    Posts
    35

    Re: Force a list that has rounding issues to equal a set amount

    Ah - as is the case with these things as soon as you realise what you need precisely, you can go about hunting it on the ever knowledgeable Google One quick search for integer sum got me this http://www.youtube.com/watch?v=4VscDxRErNs perfect! :D

    Thank you all again, I'll mark this solved!

  14. #14
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Force a list that has rounding issues to equal a set amount

    Im glad you managed to solve your problem

    I am interested in what fixed it, but an unable to connect to youtube here (at work, and firewall etc). any chance of uploading the worksheet with rge solution in it?

  15. #15
    Registered User
    Join Date
    12-14-2012
    Location
    England
    MS-Off Ver
    2007
    Posts
    35

    Re: Force a list that has rounding issues to equal a set amount

    That's the least I could do :D

    The array formula I've used is {=SUM(INT(O3:O7))}

    Thank you again for all your help.
    Attached Files Attached Files

  16. #16
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Force a list that has rounding issues to equal a set amount

    Nice solution, thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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