The MOD function in Excel returns the remainder after one number is divided by another. It’s commonly used for tasks like repeating patterns, alternating values, grouping data, and working with cycles such as days, shifts, or batches.
MOD is especially useful when you need to determine whether a number divides evenly, create repeating sequences, or organize data into consistent intervals.
In this guide, you’ll learn:
- What the MOD function does
- How to write a MOD formula
- How to calculate remainders in Excel
- How to test whether numbers are even or odd
- How to build repeating patterns using MOD
- Common mistakes to avoid when using MOD
What Is the MOD Function in Excel?
The MOD function returns the remainder after division.
For example:
- 10 ÷ 3 leaves a remainder of 1
- 15 ÷ 5 leaves a remainder of 0
- 22 ÷ 4 leaves a remainder of 2
Excel calculates this automatically using MOD.
MOD Function Syntax
The syntax for MOD is:
=MOD(number, divisor)
Argument Breakdown
number — The number you want to divide
divisor — The number you want to divide by
The result will always be the remainder.
Example Dataset Used in This Tutorial
You can download the sample data we’ll be using in this tutorial by clicking on this link—> MOD Function Data
Basic MOD Example
Let’s calculate remainders from simple division.

Click into cell C2
Enter:
=MOD(A2,B2)
Press Enter
Drag the formula down
You’ll now see the remainder for each division.

Using MOD to Test Even and Odd Numbers
One of the most useful MOD tricks is determining whether numbers are even or odd.
Even numbers divide evenly by 2.
That means:
- Even numbers → remainder 0
- Odd numbers → remainder 1
In F2, enter:
=MOD(F2,2)
Drag down
Press Enter

Using MOD to Create Repeating Patterns
MOD is extremely useful for creating repeating cycles.
For example:
Repeat values every 3 rows.
In I2, enter:
=MOD(I2,3)
Press Enter
Drag down

Using MOD to Group Items into Batches
MOD helps divide items into fixed-size groups.
Example: Assign items into groups of 4.
In L2, enter:
=MOD(L2,4)
Press Enter
Drag down
Common MOD Mistakes to Avoid
Using Zero as the Divisor
This causes an error:
=MOD(10,0)
Result:
#DIV/0!
Always use a non-zero divisor.
Forgetting What the Result Represents
MOD returns the remainder, not the result of division.
Example:
=MOD(10,3)
Returns:
1
Not:
3.33
Misunderstanding Zero Results
If MOD returns 0, it means the number divides evenly.
Example:
=MOD(20,5)
Returns:
0
Why the MOD Function Matters
MOD is one of the most powerful building blocks in Excel because it enables:
- Alternating row formatting
- Repeating sequences
- Batch processing
- Even/odd logic
- Cyclical calculations
Example Dataset Used in This Tutorial
You can download the sample data we’ll be using in this tutorial by clicking on this link—> MOD Function Data



