0

I have an Excel validation formula which worked fine in Office '03, '07, but is failing in 2010. Did they change the definition of MOD recently?

In 03/07 the following returns zero:

=MOD(1, .05)

However in 2010 it returns .05.

As far as I can tell they haven't changed how remainders worked since I was in 3rd grade when I learned about them. However, Microsoft may be taking certain liberties.

Chris Pfohl
  • 18,220
  • 9
  • 68
  • 111
  • [Similar issue (floating point error) for Python](https://stackoverflow.com/questions/4218961/why-fmod1-0-0-1-1). – user202729 Jul 27 '18 at 13:08

2 Answers2

0

Actually... it does not return zero in Office 2007, but -0.000000000000000056 (just tested).

Maybe it's a floating point issue or the way Excel 2010 handles floating point changed.

Tiago Cardoso
  • 2,057
  • 1
  • 14
  • 33
  • Excel 2010 did fix a bug with the MOD function http://en.wikipedia.org/wiki/Microsoft_Excel#Excel_MOD_function_error.It looks to me like they introduced another one, but you'd need to find the definition of the function for a non integer divisor. – paulmorriss Mar 18 '11 at 10:24
0

So I finally decided the best way to determine this was to cheat and do:

=(1/.05)-(floor(1/.05))

That gives me the zero I need.

Chris Pfohl
  • 18,220
  • 9
  • 68
  • 111