➕ Math Function · intermediate
MOD Function in Google Sheets
Returns the remainder of a division. Used for divisibility tests, cycles, and conditional formatting stripes.
Syntax
MOD(dividend, divisor)Returns: Remainder of dividend / divisor.
Excel equivalent: MOD (identical)
Parameters
| Name | Required | Description |
|---|---|---|
| dividend | Required | Number being divided. |
| divisor | Required | Number doing the dividing. Cannot be zero. |
Examples
Even/odd
=IF(MOD(A2, 2) = 0, "Even", "Odd")MOD 2 = 0 for even, 1 for odd.
Alternating rows (CF)
=MOD(ROW(), 2) = 0Custom formula in conditional formatting.
Repeating cycle
=MOD(A2 - 1, 7) + 1Cycles 1-7-1-7...
When to use an alternative
- QUOTIENT — Want integer division, not remainder.
Common errors and how to fix them
#DIV/0!
Cause: Divisor zero/blank.
Fix: Validate first.
Negative remainder
Cause: MOD follows divisor's sign.
Fix: MOD(MOD(x, d) + d, d) for positive.
Related functions
ROUND
Rounds a number to a specified number of decimal places using standard half-away-from-zero rounding....
ABS
Returns the absolute value of a number....
ROUNDDOWN
Rounds a number TOWARD zero to a specified number of decimal places....
ROUNDUP
Rounds a number AWAY from zero to a specified number of decimal places....
SUM
Adds up numbers in a range or list of values. The first function nearly every spreadsheet user learn...
Frequently Asked Questions
Negative results?
When divisor is negative. MOD(7, -3) = -2.
Other uses?
Striping rows, cycling lists, extracting components from packed numbers.