Share via

Excel MOD bug?

Tomsk6653 0 Reputation points
2025-07-19T14:07:01.8566667+00:00

Using Microsoft 365 - Excel version 2507 - build 19029.20076

I was experimenting with the MOD function and came across a minor bug.

In excel MOD(23.1,2.1) gives a result of 4.44089E-16

It should be zero

I know MOD is meant to be used with integers, but I thought you might like to know.

Microsoft 365 and Office | Excel | For home | Windows
0 comments No comments

1 answer

Sort by: Most helpful
  1. HansV 462.6K Reputation points MVP Volunteer Moderator
    2025-07-19T14:31:37.8433333+00:00

    This is a known issue - floating point calculations in Excel produce tiny rounding errors, due to the way numbers with decimals are stored and processed.

    Simply use the ROUND function to mitigate this. Since both inputs have 1 decimal place, use

    =ROUND(MOD(23.1, 2.1), 1)

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.