Math & Trig

MOD Formula

MOD returns the remainder after dividing one number by another. It is essential for alternating row formatting, determining if a number is even or odd, cycling through repeating patterns, converting time units, and checking divisibility. MOD(number, divisor) gives what is left over after integer division.

Syntax

MOD(number, divisor)
ParameterDescription
number Parameter of the MOD function.
divisor Parameter of the MOD function.
Try MOD in Viztab — free, no signup

Examples

Check if a number is even or odd

Formula
=IF(MOD(A2, 2)=0, "Even", "Odd")
Returns: "Even" for 42, "Odd" for 37 — MOD by 2 returns 0 for even numbers

Alternating row colors (conditional formatting)

Formula
=MOD(ROW(), 2)=0
Returns: TRUE for even rows — use this in conditional formatting to stripe every other row

Convert total minutes to remaining minutes

Formula
=MOD(A2, 60)
Returns: 25 — from 145 total minutes, 25 minutes remain after 2 full hours

Common Errors

#DIV/0!

The divisor is 0. You cannot divide by zero. Check the divisor value or wrap with IFERROR.

#VALUE!

One of the arguments is text. Both arguments must be numbers.

Tips

Cyclic patterns

=MOD(ROW()-1, 4)+1 cycles through 1,2,3,4,1,2,3,4... — useful for repeating assignments or grouping.

Time conversion

Hours from minutes: =INT(A1/60). Remaining minutes: =MOD(A1, 60). Together: INT(145/60)&":"&MOD(145,60) = "2:25".

Check divisibility

=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

Related Formulas