+ Reply to Thread
Results 1 to 13 of 13

How to Stop Rounding Errors?

  1. #1
    Registered User
    Join Date
    09-21-2014
    Location
    East Lansing, MI
    MS-Off Ver
    2007
    Posts
    7

    How to Stop Rounding Errors?

    Hi again, so for my excel sheet I need to do three sets of calculations that require me to use ROUNDUP and ROUNDDOWN for 1000 calculations, and I keep getting that array error and I'm not really sure what to do :/ got my precision set and everything. Maybe the problem is I'm doing something like =ROUNDDOWN(F2:F1000*G2:G1000,0)?

    For the ROUNDDOWN, I need to get my numbers to have decimal places at .00 (so instead of 101.01 it would be rounded to 101.00)

    etc etc

  2. #2
    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,936

    Re: How to Stop Rounding Errors?

    rounddown works on a cell, not an array (as far as I know)

    Perhaps you need something like this...

    =ROUNDDOWN(sumproduct((F2:F1000)*G2:G1000)),0)
    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

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,446

    Re: How to Stop Rounding Errors?

    Or, conversely:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    And I think it needs a few less brackets.

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Note that the first does the rounddown in pairs and adds up whereas the second does the rounddown on the total

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    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,936

    Re: How to Stop Rounding Errors?

    Quote Originally Posted by TMS View Post
    And I think it needs a few less brackets.
    Regards, TMS
    True, I add them out of (bad) habbit lol...and actually, there was 1 missing...
    =ROUNDDOWN(sumproduct((F2:F1000)*(G2:G1000)),0)

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,446

    Re: How to Stop Rounding Errors?

    ... and actually, there was 1 missing...
    I know

    To be honest, I usually put the extra brackets in because it helps me to see the ranges and how they are manipulated better. My bad habit is using a double negative where I don't always need it. It looks prettier

    Regards, TMS

  6. #6
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: How to Stop Rounding Errors?

    Quote Originally Posted by FDibbins View Post
    True, I add them out of (bad) habbit lol...and actually, there was 1 missing... =ROUNDDOWN(sumproduct((F2:F1000)*(G2:G1000)),0)
    Or simply:

    =ROUNDDOWN(SUMPRODUCT(F2:F1000,G2:G1000),0)
    or
    =INT(SUMPRODUCT(F2:F1000,G2:G1000))

    @funwithcolors: Compare ROUNDDOWN(-1.1,0) and INT(-1.1) to see which you want, if that is even relevant.
    Last edited by joeu2004; 09-21-2014 at 07:59 PM.

  7. #7
    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,936

    Re: How to Stop Rounding Errors?

    If no decimal places are required (as it seems) then using INT() is indeed a good option to use

  8. #8
    Registered User
    Join Date
    09-21-2014
    Location
    East Lansing, MI
    MS-Off Ver
    2007
    Posts
    7

    Re: How to Stop Rounding Errors?

    Okay, I got it. Thanks! but another q: what about for if I want only certain numbers to round up or down for tons of data?

  9. #9
    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,936

    Re: How to Stop Rounding Errors?

    hard to say without seeing samples of what you are working with Are those numbers the result of input or formula?

  10. #10
    Registered User
    Join Date
    09-21-2014
    Location
    East Lansing, MI
    MS-Off Ver
    2007
    Posts
    7

    Re: How to Stop Rounding Errors?

    Halfway positive I attached a screenshot of my sheetbook onto this post. I'm pretty much using the results from column F (F2:f1000) [which were obtained through a formula] to get the highlighted row K results (which is decimals rounded to the fifth point [.00000] that are rounded up or down based on the number after the decimal)
    Attached Images Attached Images

  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,936

    Re: How to Stop Rounding Errors?

    OK we cant work with pictures, please upload a sample workbook

  12. #12
    Registered User
    Join Date
    09-21-2014
    Location
    East Lansing, MI
    MS-Off Ver
    2007
    Posts
    7

    Re: How to Stop Rounding Errors?

    Oops! sorry about that. Here you go.
    Attached Files Attached Files

  13. #13
    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,936

    Re: How to Stop Rounding Errors?

    You could use this in I2 instead of that array formula...
    =MROUND(F2,0.01)

    For the other rounding, perhaps just...
    =ROUND(F2,2)

+ 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. rounding errors in sum function?
    By AngelaBenett in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-12-2013, 01:31 AM
  2. Excel 2007 : rounding errors
    By meonly123 in forum Excel General
    Replies: 1
    Last Post: 09-24-2011, 08:07 PM
  3. Rounding errors
    By Divran in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-07-2010, 05:25 AM
  4. Rounding Errors Help
    By mattflow in forum Excel General
    Replies: 2
    Last Post: 08-12-2005, 04:05 PM
  5. How Stop Rounding Errors?
    By Al Franz in forum Excel General
    Replies: 3
    Last Post: 01-30-2005, 12:07 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