logical function bug?

  • Thread starter Thread starter rgs
  • Start date Start date
R

rgs

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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top