+ Reply to Thread
Results 1 to 3 of 3

excel bug

  1. #1
    Registered User
    Join Date
    05-07-2012
    Location
    tehran
    MS-Off Ver
    Excel 2007
    Posts
    1

    Exclamation excel bug

    hi everybody
    I think I find a bug in excel 2007 as follow:

    select a cell and type this formula on it;
    =IF(A1/0.3-INT(A1/0.3)>0;"yes";"no")
    in cell a1 type 1.8 the formula shows "no" its correct
    in cell a1 type 1 the formula shows "yes" its correct
    in cell a1 type 1.5 the formula shows "no" its correct


    but if type 2.1 or 2.5 or 2.7 on the cell a1 that formula shows "yes"
    its very big mistake

    generally excel have problem with this formula
    check other numbers
    what is your opinion?

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: excel bug

    Hi,

    No it's not a bug or error. Merely the well known problem associated with any computer system and floating point arithmetic.

    See
    http://support.microsoft.com/kb/78113
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Valued Forum Contributor
    Join Date
    10-06-2008
    Location
    Norway
    MS-Off Ver
    2010
    Posts
    365

    Re: excel bug

    Hi, this can certainly be a problem, but is not really a bug in Excel. This topic has been addressed a number of times in the forum. The following is copied from http://support.microsoft.com/kb/214118:

    "Many combinations of arithmetic operations on floating-point numbers in Microsoft Excel and Microsoft Works may produce results that appear to be incorrect by very small amounts. For example, the equation =1*(.5-.4-.1) may be evaluated to the quantity (-2.78E-17), or -0.0000000000000000278 instead of 0.

    This behavior is not a problem in or a limitation of Excel or Works; this behavior occurs because the Institute of Electrical and Electronics Engineers (IEEE) 754 floating-point standard requires that numbers be stored in binary format.

    Method 1
    To minimize any effects of floating point arithmetic storage inaccuracy, use the Round() function to round numbers to the number of decimal places that is required by your calculation. For example, if you are working with currency, you would likely round to 2 decimal places:

    =ROUND(1*(0.5-0.4-0.1),2)"

    For more info, read for example the article "Floating-point arithmetic may give inaccurate results in Excel", which you can find here:http://support.microsoft.com/kb/78113/en-us

+ 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