+ Reply to Thread
Results 1 to 3 of 3

Adding a positive and a negative number

  1. #1
    Registered User
    Join Date
    08-03-2007
    Posts
    2

    Adding a positive and a negative number

    I’m adding two numbers together (a positive and a negative) and the correct result is displayed but the formula evaluation shows the result is actually being computed to 13 decimal places with a 4 on the end.

    I’ve verified the cell formatting is correctly set to Currency and 2 decimal places and varied all the settings under Tools/Options/Calculation. Don’t know why this is happening.

    Details:

    C7 C8 =(C7+C8)
    $10,893 + ($10,805.15) = $87.85

    Formula evaluation shows 87.850000000004

    This causes a problem when I have to compare the result of this cell with another one.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    This is caused by the way Excel calculates (using binary numbers), see here.

    The simplest way to avoid this is to use ROUND, e.g.

    =ROUND(C7+C8,2)

  3. #3
    Registered User
    Join Date
    08-03-2007
    Posts
    2
    Thanks daddylonglegs.

    It worked!

+ 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