+ Reply to Thread
Results 1 to 5 of 5

Excel 2003 Calculation Problem

  1. #1
    Forum Contributor
    Join Date
    04-03-2009
    Location
    Anchorage, Alaska, USA
    MS-Off Ver
    Office 365
    Posts
    113

    Excel 2003 Calculation Problem

    I have Excel 2003 (11.8237.8221) SP3 according to the ABOUT screen in the
    HELP menu. The three numbers and their cell locations are:

    F17 = 1887.36
    F18 = 314.56
    F21 = 314.56

    Note that 314.56 x 6 = 1887.36, so why is this happening?

    The formula =(1887.36-314.56)/314.56 equals 5
    but the formula =MOD(1887.36-314.56,314.56) equals -5.68434E-14

    (for this next one I formatted the digits in the Excel cell as far as I
    thought good)
    The formula =(F17-F18)/F21 equals 5.000000000000000
    but the formula =MOD(F17-F18,F21) equals 0.000000000000171

    Why?
    How do I fix it?

    - Eric

  2. #2
    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: Excel 2003 Calculation Problem

    You only get about 15 digits of precision in a double-precision floating point number. It's a limitation of the way computers store real numbers.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    04-03-2009
    Location
    Anchorage, Alaska, USA
    MS-Off Ver
    Office 365
    Posts
    113

    Re: Excel 2003 Calculation Problem

    That's right.

    But I shouldn't need 15-digits of precision. I shouldn't need one. It should calculate to a whole number without decimal places. Please re-create this on your own Excel 2003 (or whatever version you have). Any ideas?

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

    Re: Excel 2003 Calculation Problem

    The point is that computers use binary code and calculate using binary numbers. We use base 10 and sometimes there are slight differences between them as there is not always a real number equivalent between them. The results to your formula should be 0.0 but when performed in binary, you get that discrepancy at the 15th,16th place. The only way to get around that is to use the ROUND function.
    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

  5. #5
    Forum Contributor
    Join Date
    04-03-2009
    Location
    Anchorage, Alaska, USA
    MS-Off Ver
    Office 365
    Posts
    113

    Re: Excel 2003 Calculation Problem

    ROUND. Thank you.

+ 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