Math & trig · remainder · Nov 16, 2026

The MOD function,
measured & explained.

MOD returns the remainder after division. The result takes the sign of the divisor — the gotcha that trips up almost everyone. This page measures all four sign combinations plus the everyday odd/even and every-nth-row uses.

D1
fx
=MOD(10, 3)
0
measured gallery rows
0
sourced errors fixed
0
platforms checked
// 01 — Anatomy

How MOD works

Returns the remainder, carrying the sign of the divisor. MOD(5,0) is #DIV/0!.

=MOD(number, divisor)
numberThe dividend.
divisorThe number to divide by; must not be 0.
.bool-moat td.res-text{color:var(--cyan);font-weight:700;font-family:var(--mono)}
// 02 — The sign rule

What MOD actually returns

The #1 MOD gotcha is the sign: Excel's result follows the divisor, not the dividend. All four sign combinations, measured live. Click any row to load it.

Sign-of-divisor matrix

ExpressionResultWhy
=MOD(10,3)110 = 3*3 + 1
=MOD(-10,3)2Result takes the divisor sign (+)
=MOD(10,-3)-2Result takes the divisor sign (-)
=MOD(-10,-3)-1Result takes the divisor sign (-)
=MOD(7,2)11 = odd, 0 = even
=MOD(10,10)0Exact multiple, no remainder
=MOD(0,5)0Zero mod anything is 0
=MOD(5,0)#DIV/0!Cannot divide by zero

Everyday uses

ExpressionResultWhy
=MOD(7,2)1odd/even test: 1 odd, 0 even
=MOD(ROW(),2)0band every other row (conditional formatting)
⚠ MOD(a,b) carries the sign of b: MOD(-10,3)=2 (not -1) and MOD(10,-3)=-2. This differs from the % operator in many languages. MOD(x,0) is always #DIV/0!.
MOD pairs with SUMPRODUCT to sum alternating rows, and with IF to branch on odd/even. QUOTIENT gives the integer half of a division; MOD gives the remainder.
// 03 — Try it live

Interactive MOD playground

Edit the table or type any formula — the engine evaluates instantly. Load a preset to see MOD take the divisor's sign, test odd/even, and hit the zero-divisor trap.

A1Sample data — click any cell to edit, the formula re-evaluates live
Result
—
✓ readyHyperFormula 3.5
// 04 — Error library

The real-world error library

8 failure patterns mined from actual user reports on Reddit, Stack Overflow and Super User — each with the authentic symptom, root cause, a fix, and a runnable formula. Not textbook theory.

// 05 — Cross-platform

Where MOD works

MOD is available in Excel 2003+, Microsoft 365, Excel for the web and Google Sheets. The sign-of-divisor rule is consistent across them; the % operator in some languages differs.

PlatformSupportNotesGotcha
✓ Supported full MOD◐ Partial works with caveatsCompiled from public docs · verify against your build
// Go deeper

Master remainders

MOD is one piece. The full course walks the toolkit end to end with live, measured examples.

  • The sign-of-divisor rule (all four cases)
  • Odd/even and every-nth-row banding
  • MOD + SUMPRODUCT for alternating sums
  • MOD vs QUOTIENT
Free while in beta
Browse the function library

No account needed. Every page has a live playground.

// 07 — FAQ

Frequently asked