MOD Function

Excel 2007+

Summary

The Excel MOD function calculates the remainder after dividing one number by another. Unlike standard division, MOD preserves the sign of the divisor in the result, making it invaluable for cyclic calculations, date arithmetic, and modular operations.

Syntax

MOD(number, divisor)

Parameters

Parameter Type Required Description
number Number Yes The number for which you want the remainder after division
divisor Number Yes The number by which to divide the first argument

Using the MOD Function

MOD excels in scenarios requiring remainder calculations, such as determining positions in cycles, wrapping dates around months, or creating repeating patterns. Its unique sign preservation distinguishes it from simple division operators.

Common MOD Examples

Basic Positive Division

=MOD(3,2)

Remainder of 3 divided by 2 returns 1

Negative Dividend Example

=MOD(-3,2)

Remainder of -3/2 returns 1 (same sign as divisor 2)

Negative Divisor Example

=MOD(3,-2)

Remainder of 3/-2 returns -1 (same sign as divisor -2)

Date Wrapping Example

=MOD(45000,365)

Find day of year from Excel date serial (45000 mod 365)

Frequently Asked Questions

#DIV/0! error is returned

Yes, Excel dates are serial numbers so MOD functions perfectly

MOD returns integer remainder with divisor sign; / returns decimal quotient

Common Errors and Solutions

#DIV/0!

Cause: Divisor argument is zero

Solution: Ensure divisor is never zero

#VALUE!

Cause: Non-numeric arguments provided

Solution: Verify both arguments contain numbers

Notes

  • MOD(n,d) = n - d*INT(n/d)
  • Result always has same sign as divisor
  • Useful for week/day calculations from dates
  • Common in game development (board positions)

Compatibility

Available in: Excel 2007, Excel 2010, Excel 2013, Excel 2016, Excel 2019, Excel 2021, Microsoft 365

Not available in:

Content last reviewed: December 11, 2025
Update frequency: As needed
Excel versions tested: Excel 2007+