+ Reply to Thread
Results 1 to 6 of 6

Excel 2007 : Rounding Error in Excel calculations

Hybrid View

  1. #1
    Registered User
    Join Date
    10-13-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Rounding Error in Excel calculations

    I have used conditional formatting to show a cell in bold red when it is not equal to zero.

    So I could not understand why if:
    • The formula for B3 is A3-C3-D3;
    • A3=242.57 C3=111.23 and D3=131.34; and
    • The result should be 0
    Excel displays the result in bold red until I increase the number of decimal places to 14 and discovered Excel was calculating the result as -0.00000000000003

    WHY IS THAT?

    The same formula does not produce this behaviour for values
    Last edited by dav1129; 10-23-2010 at 11:44 PM.

  2. #2
    Registered User
    Join Date
    10-11-2010
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Excel calculation.

    You could try adding the ROUND function so that it doesn't go out to 14 decimal points. I've attached a sample that works.
    Attached Files Attached Files
    Last edited by karenbr; 10-13-2010 at 11:55 PM. Reason: I hit enter and it posted before I could attach a sample
    Karen

  3. #3
    Registered User
    Join Date
    10-13-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Excel calculation.

    Quote Originally Posted by karenbr View Post
    You could try adding the ROUND function so that it doesn't go out to 14 decimal points. I've attached a sample that works.
    thanks for the reply and suggestion. i'll try it. but i don't understand why if you get zero when you do the arithmetic mentally or with a calculator but excel does not.

    why is excel even getting -0.00000000000003 and not zero or 0.00?

    ps tried your suggestion and in essence. it's no good because if the result is within 0.49 either side of 0.00 I don't see it. and the whole idea of this (larger) spread sheet is to pick up and identify discrepancies.

    i come back to 'why is excel even getting -0.00000000000003 and not zero or 0.00? when the result should simply be 0.00.
    Last edited by dav1129; 10-14-2010 at 02:48 AM.

  4. #4
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Excel calculation.

    It's an older article, but the situation hasn't changed, and it does describe "Rounding Errors" very well.
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  5. #5
    Registered User
    Join Date
    10-13-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Excel calculation.

    Quote Originally Posted by ConneXionLost View Post
    It's an older article, but the situation hasn't changed, and it does describe "Rounding Errors" very well.
    Thanks for the explanation. Although I don't at the moment have the time to read and importantly understand the explanation given it would seem it details the correct explanation.

    Nonetheless I have a simple formula which in this case is equal to:

    242.57 - 111.23 - 131.34

    Done on a calculator this clearly should equal zero. Excel is also showing this a 0.00 (rounded to two decimal places) but if in fact, you format the cell to round to 14 decimals Excel thinks the result is -0.00000000000001 as so on as you increase the number of cells Excel should the result to.

    Because I have series of cells with conditional formatting to highlight results which are NOT equal to zero, the consequence that even rounded to 2 decimals Excel showing the result in BOLD RED.

    So I other than try to ignore these errors I don't know how to handle them.

  6. #6
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: Excel calculation.

    If your decimal precision never needs to exceed, say, 3 decimal places, then round all values to the 5th decimal place. This will handle almost all discrepancies due to this type of Excel rounding errors.

    =ROUND(A1,5)

+ 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