MOD Function in Excel

Intermediate

Returns the remainder after a number is divided by a divisor.

Syntax

=MOD(number, divisor)

Example

Use Case

Determine if a number is even or odd (MOD of 2).

Common Errors to Avoid

  • Result has same sign as divisor, not dividend
  • #DIV/0! error if divisor is zero
  • MOD(-10, 3) = 2, not -1 (result takes sign of divisor)

Pro Tips

MOD(n,2)=0 tests for even numbers. Use for alternating row colors: =MOD(ROW(),2)=0. Great for cycling through patterns. For time calculations: MOD(hour,24) ensures 24-hour format. Combine with IF for conditional logic based on remainders.

Need help with this formula?

Our AI Formula Generator can write this for you instantly.

Try AI Formula Generator →
MOD Function in Excel | Excel AI Tools