operation with excel

  • Thread starter Thread starter GJ
  • Start date Start date
G

GJ

Hi,
I don't undestand why I don't have the same result with these two formulas :

=IF(1.02-1.01=0.01,"ok","not ok") => the result is : ok

=IF(2.02-2.01=0.01,"ok","not ok") => the result is : not ok

Thanks

GJ
 
GJ

If you enter the two operations directly in cells

=2.02-2.01 returns 0.01

=1.02-1.01 returns 0.01

Now increase the decimal point to about 15 and you will see the first is
0.0100000000000200

And the other is 0.010000000000000 forever.

Excel's method of dealing with floating point math.

Others will undoubtedly explain the reason for this. Keep posted.

Gord Dibben Excel MVP
 

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