Excel MOD Function

MOD returns the remainder after one number is divided by another.

Use it to detect divisibility, cycle through repeating groups, separate whole periods from leftovers, or flag values that land on an interval.

1
Choose a number This is the value to divide
2
Choose a divisor Excel divides by this amount
3
Return the remainder Zero means it divides evenly

MOD syntax & arguments

Syntax

=MOD(number, divisor)
Required Optional
  1. 1

    number

    Required

    The number to divide.

  2. 2

    divisor

    Required

    The number to divide by. MOD returns the remainder after this division.

Example

=MOD(A2, 7)

Return the remainder after dividing A2 by 7.

MOD caveats

  • The divisor cannot be zero

    =MOD(A2,0) returns a #DIV/0! error because division by zero is not allowed.

  • A zero remainder means an even division

    Use =MOD(value, divisor)=0 as the general pattern for testing whether a value divides evenly.

  • The result follows the divisor sign

    When negative values are involved, Excel returns a remainder with the same sign as divisor.

  • Decimals can expose precision issues

    When inputs have long decimals, use ROUND first if small decimal rounding differences would change the remainder test.

Need rotating labels? Use MOD to turn item numbers like 1, 2, 3, 4, 5, 6 into repeating positions like 1, 2, 3, 1, 2, 3, then use CHOOSE to pick the matching label. For example, =CHOOSE(MOD(A2-1,3)+1,"North","East","West") rotates assignments across North, East, and West as the item number increases.

Intro MOD practice problems

No intro MOD problems are currently available.

Advanced MOD practice problems

Use MOD alongside other Excel functions in realistic, less-prescriptive challenges.