Math function
Excel MOD function
MOD divides one number by another and returns what is left over. Use it to find leftovers after packing, spot odd and even numbers, or repeat a pattern every nth row.
=MOD(number, divisor)Arguments
number- The number to divide.
divisor- The number to divide by. It cannot be 0.
MOD examples
Every result below was calculated live from this sample sheet.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Batch | Cookies | Per tin | Shift minutes |
| 2 | Mon | 140 | 24 | 475 |
| 3 | Tue | 96 | 24 | 510 |
| 4 | Wed | 155 | 24 | 390 |
Result: 20
140 cookies fill 5 tins of 24 with 20 left over.
Result: 55
Minutes past the hour: a 475-minute shift is 7 hours and 55 minutes.
Result: Odd
A remainder of 0 when dividing by 2 means the number is even.
Result: 2
The result takes the sign of the divisor, so -7 mod 3 is 2, not -1.
How to use MOD
- Click an empty cell.
- Type =MOD( and the number to divide.
- Type a comma and the divisor.
- Close the bracket and press Enter.
Common MOD mistakes
Dividing by zero
MOD(x,0) returns #DIV/0!. Check the divisor first, or wrap the formula in IFERROR.
Expecting a negative remainder
Excel gives the result the same sign as the divisor. MOD(-7,3) is 2, which is different from some programming languages.
Wanting the whole-number part
MOD only returns the remainder. Use INT(number/divisor) or QUOTIENT for how many times it fits.
MOD FAQ
What does MOD do in Excel?
It returns the remainder after division. MOD(10,3) is 1, because 3 goes into 10 three times with 1 left over.
How do I check if a number is even in Excel?
Use =MOD(A1,2)=0. It returns TRUE for even numbers. You can also use ISEVEN(A1).
How do I highlight every other row in Excel?
Use conditional formatting with the formula =MOD(ROW(),2)=0. It colors every even-numbered row.
Guides that use MOD
Related functions
INTRounds down to integerROUNDDOWNRounds toward zeroIFPicks a result from a testABSAbsolute value
Updated 2026-10-31