MOD
Returns the remainder after division. Useful for checking divisibility or cyclic patterns.
MOD(number, divisor)Arguments
numberThe number to dividedivisorThe number to divide by
=MOD(10,3)10 divided by 3 leaves remainder 1
=MOD(A1,2)=0Tests if A1 is even
=MOD(ROW(),2)Alternates for formatting every other row
- •MOD(n,2)=0 tests for even numbers
- •Useful for cyclic patterns (every Nth row)
- •Result has same sign as divisor
- •Forgetting MOD returns a result with the same sign as the divisor, not the dividend - MOD(-7,3) returns 2, not -1, which trips up people expecting a simple remainder
- •Using MOD with a divisor of 0, which returns a #DIV/0! error just like regular division
- •Confusing MOD with a manual remainder trick using floating-point numbers, where tiny precision errors can make it return an unexpected non-zero result for values that should divide evenly
Why does MOD return a positive number for a negative input?
MOD's result always takes the sign of the divisor, not the dividend. MOD(-7,3) returns 2 because it follows 3's positive sign, not -1 as a simple remainder calculation might suggest.
How do I check if a number is even or odd with MOD?
MOD(number,2) returns 0 for even numbers and 1 for odd numbers - a common pattern, though ISEVEN and ISODD do this more directly.
What happens if I divide by zero with MOD?
It returns a #DIV/0! error, the same as any other division by zero in Excel.
Need to translate a formula using MOD?
Use our translator to convert your complete formula
