Skip to main content
SheetCraft
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

NameRequiredDescription
dividendRequiredNumber being divided.
divisorRequiredNumber 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) = 0

Custom formula in conditional formatting.

Repeating cycle

=MOD(A2 - 1, 7) + 1

Cycles 1-7-1-7...

When to use an alternative

  • QUOTIENTWant 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

Frequently Asked Questions

Negative results?

When divisor is negative. MOD(7, -3) = -2.

Other uses?

Striping rows, cycling lists, extracting components from packed numbers.

Source: Google Sheets official function reference.