Formula Guide

The Excel MOD Function
explained simply

MOD returns the remainder after division. Use it to identify odd/even rows, create repeating cycles, check divisibility, and build alternating patterns.

ExcelPro · 6 min read · Updated June 2026

What does it do?

MOD returns the remainder after dividing one number by another. MOD(10,3) returns 1 because 10 divided by 3 leaves a remainder of 1. While simple, MOD is surprisingly useful — alternating row colours, identifying even/odd numbers, creating repeating cycles, and checking whether values are multiples of something.

Syntax

=MOD(number, divisor)
ArgumentDescription
=MOD(number, divisor)
number requiredThe number to divide.
divisor requiredThe number to divide by.

Real examples

Example 1
Identify odd vs even rows
=IF(MOD(ROW(),2)=0,"Even","Odd")

Used in conditional formatting to highlight alternate rows.

Example 2
Check if a number is divisible by N
=IF(MOD(A2,3)=0,"Divisible by 3","Not divisible")

MOD returns 0 when there is no remainder.

Example 3
Create a repeating sequence 1-4
=MOD(ROW()-1,4)+1

Produces 1,2,3,4,1,2,3,4... down a column — useful for assigning groups.

Example 4
Extract the minutes from a decimal hour
=MOD(A2,1)*60

A2 = 2.75 hours → 0.75*60 = 45 minutes.

Example 5
Check if a year is a leap year
=IF(MOD(A2,4)=0,"Leap year","Regular year")

A simplified check — full leap year logic also checks MOD 100 and MOD 400.

FAQ

What does MOD return when there is no remainder?
0. So MOD(12,3) returns 0 because 12 divides by 3 exactly.
Can MOD work with negative numbers?
Yes, but the result takes the sign of the divisor, not the dividend. MOD(-7,3) returns 2 (not -1). This matches mathematical convention.
What if the divisor is 0?
MOD(x,0) returns a #DIV/0! error — same as dividing by zero in any formula.

MOD for cycling, grouping, and scheduling

MOD creates repeating cycles — one of its most practical uses. =MOD(ROW()-1,4)+1 produces the sequence 1,2,3,4,1,2,3,4... down a column. This lets you assign four rotating groups to a list of items, people, or dates without any manual effort. Change the 4 to any number for differently sized cycles.

In scheduling, MOD can identify which shift rotation applies on a given date. If you have a 7-day rota that started on a known date, =MOD(A2-start_date,7)+1 tells you which day of the rota any future date falls on — automatically handling years and leap years.

MOD is also the standard way to implement alternating row shading in conditional formatting. Apply the rule =MOD(ROW(),2)=0 to shade every even row, creating a zebra-stripe pattern that makes large tables much easier to read. This is a pure MOD calculation — no helper column needed.

💡 MOD for check digits

Many reference numbers (ISBNs, IBANs, bar codes) use a check digit calculated with MOD. The Luhn algorithm used in credit card validation uses repeated MOD 10 calculations. Excel's MOD makes it straightforward to implement these validation checks in a spreadsheet.

Practise this formula live

ExcelPro has exercises covering this formula across multiple tracks. Free to start.

Try exercises →

Related formulas

IF CHOOSE ROUND INT SUMPRODUCT LARGE