Syntax
| Parameter | Description |
|---|---|
| number | Parameter of the MOD function. |
| divisor | Parameter of the MOD function. |
Examples
Check if a number is even or odd
=IF(MOD(A2, 2)=0, "Even", "Odd")
Alternating row colors (conditional formatting)
=MOD(ROW(), 2)=0
Convert total minutes to remaining minutes
=MOD(A2, 60)
Common Errors
The divisor is 0. You cannot divide by zero. Check the divisor value or wrap with IFERROR.
One of the arguments is text. Both arguments must be numbers.
Tips
=MOD(ROW()-1, 4)+1 cycles through 1,2,3,4,1,2,3,4... — useful for repeating assignments or grouping.
Hours from minutes: =INT(A1/60). Remaining minutes: =MOD(A1, 60). Together: INT(145/60)&":"&MOD(145,60) = "2:25".
=MOD(A1, 5)=0 checks if A1 is divisible by 5. Useful for every-Nth-item selections.
Try MOD in Viztab
Import your data and use MOD with 370+ other formulas. No signup required.
Open Viztab