Skip to content
Excel

MOD function in Excel

Returns the remainder from division

=MOD(number, divisor)

MOD syntax and parameters

Two arguments, two required.

  • numbernumberRequired

    The number for which you want to find the remainder.

  • divisornumberRequired

    The number by which you want to divide number.

MOD examples

Formulas you'll actually reuse.

  1. Units left over after filling boxes of 12:

    =MOD(B2, 12)

    Result7

  2. Every other row for banding — pair with conditional formatting:

    =IF(MOD(ROW(), 2) = 0, "shade", "")

    Result"shade"

MOD in Google Sheets

Same name — your formula ports as-is.

Try MOD in the playground

Edit the example — nothing to install.

Preloaded with the MOD formula from Example 1 — change anything and watch it respond.

Loading the editor…

MOD errors

What they mean — and the fixes.

  • #DIV/0!

    The divisor is 0 or an empty cell.