MOD returns the remainder after division. Use it to identify odd/even rows, create repeating cycles, check divisibility, and build alternating patterns.
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.
=MOD(number, divisor)| Argument | Description |
|---|---|
| =MOD(number, divisor) | |
| number required | The number to divide. |
| divisor required | The number to divide by. |
=IF(MOD(ROW(),2)=0,"Even","Odd")Used in conditional formatting to highlight alternate rows.
=IF(MOD(A2,3)=0,"Divisible by 3","Not divisible")MOD returns 0 when there is no remainder.
=MOD(ROW()-1,4)+1Produces 1,2,3,4,1,2,3,4... down a column — useful for assigning groups.
=MOD(A2,1)*60A2 = 2.75 hours → 0.75*60 = 45 minutes.
=IF(MOD(A2,4)=0,"Leap year","Regular year")A simplified check — full leap year logic also checks MOD 100 and MOD 400.
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.
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.
ExcelPro has exercises covering this formula across multiple tracks. Free to start.
Try exercises →