Share via

MOD function issue

Anonymous
2025-04-15T23:07:40+00:00

=MOD(0.6*3*25, 1) then the value is 1;

=MOD(0.6*25*3,1) then the value is 0.

Why?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

14 answers

Sort by: Most helpful
  1. Anonymous
    2025-04-16T01:24:31+00:00

    I don't understand why intermediate results affect the final results

    0 comments No comments
  2. Kevin Jones 7,260 Reputation points Volunteer Moderator
    2025-04-16T00:15:41+00:00

    Illustrated a different way without using MOD:

    =LET(Number, 0.6*3*25, IntermediateResult, Number / 1, IntermediateResult - TRUNC(IntermediateResult)) = -7.10542735760100E-15

    =LET(Number, 0.6*25*3, IntermediateResult, Number / 1, IntermediateResult - TRUNC(IntermediateResult)) = 0.00000000000000E+00

    Kevin

    0 comments No comments
  3. Kevin Jones 7,260 Reputation points Volunteer Moderator
    2025-04-16T00:11:09+00:00

    That is the same result I got. But when I looked at the result of the MOD function, that's where the significant digit noise was introduced. So, while the intermediate result appears to not have any noise, it is in there and the MOD function is picking it up.

    Kevin

    0 comments No comments
  4. Anonymous
    2025-04-16T00:02:55+00:00

    I checked the value as following:

    =if(0.6*3*25=45,"yes","no")

    It returned yes, which means no rounding issue.

    0 comments No comments
  5. Kevin Jones 7,260 Reputation points Volunteer Moderator
    2025-04-15T23:53:24+00:00

    You have run into a rare but real issue of significant digits and rounding. It isn't clear where the significant digit noise is creeping in but it is.

    The actual results of the MOD function, when enough significant digits are displayed, are:

    0.999999999999993000000000000000000000
    0.000000000000000000000000000000000000

    Kevin

    0 comments No comments