ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   logical function bug? (https://www.excelbanter.com/excel-worksheet-functions/185202-logical-function-bug.html)

rgs

logical function bug?
 
Is there a bug with logical functions and large numbers in Excel?
=54574.47-52348.24=2226.23 returns true
=4354574.47-4352348.24=2226.23 returns false
the only difference in the above 2 lines is the extra 4300000

Gary''s Student

logical function bug?
 
This is not a bug, just a normal rounding eror.
--
Gary''s Student - gsnu200781

T. Valko

logical function bug?
 
See this:

http://tinyurl.com/4jd3fa

--
Biff
Microsoft Excel MVP


"rgs" wrote in message
...
Is there a bug with logical functions and large numbers in Excel?
=54574.47-52348.24=2226.23 returns true
=4354574.47-4352348.24=2226.23 returns false
the only difference in the above 2 lines is the extra 4300000




Lars-Åke Aspelin[_2_]

logical function bug?
 
On Fri, 25 Apr 2008 14:44:00 -0700, rgs
wrote:

Is there a bug with logical functions and large numbers in Excel?
=54574.47-52348.24=2226.23 returns true
=4354574.47-4352348.24=2226.23 returns false
the only difference in the above 2 lines is the extra 4300000


This is no bug. It is just a consequence of the fact that not all
numbers are stored without rounding in the computers memory.
Computers work with binary representation of numbers and numbers
than have a finite number of decimals the way humans write them, with
10 as the base, often have an infinite number of "decimals" when 2 is
used as the base.

Example:
10.1 = 1010.00011001100110011... and so on

as there is a limited allocated space to store a number, these type of
numbers have to be truncated as some point which leads no the type
of strange observations that you have done.

You can try to enter this in a cell
=10.1-10

then increase the number of shown decimals and you will find that at
some point the displayed result is no longer 0.1
It might be 0.09999999999999996

Lars-Åke



rgs

logical function bug?
 
Thanks for the link. My original work around was to to use <.01 since these
are large dollars I'm working with, but the tip about using the Round
function in the link works great.

Thanks also to the other posters.

RGS

"T. Valko" wrote:

See this:

http://tinyurl.com/4jd3fa

--
Biff
Microsoft Excel MVP


"rgs" wrote in message
...
Is there a bug with logical functions and large numbers in Excel?
=54574.47-52348.24=2226.23 returns true
=4354574.47-4352348.24=2226.23 returns false
the only difference in the above 2 lines is the extra 4300000






All times are GMT +1. The time now is 03:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com