Mod Formula Excel

This guide treats “mod formula excel” the way busy spreadsheet users actually want it: answer first, then the reasoning. It is written for Excel but calls out every place Google Sheets differs, and the platform toggle at the top switches all shortcuts between Windows and Mac so nothing here assumes the keyboard you are not on.

Exact answer

In Excel: use =MOD(number, divisor) — it returns the remainder after division, so =MOD(17, 5) returns 2.

On this page8

Syntax

=MOD(number, divisor)

Arguments

Argumentrequired / optionalDescription
numberrequiredThe value to divide.
divisorrequiredWhat to divide by. Zero returns #DIV/0!.

Related functions

INTQUOTIENTROUNDUP
Annotated stepsExcel
1

Select the cell for the remainder and type =MOD(.

2

Select the total, type a comma, then enter the divisor.

3

Press Enter. Pair it with =INT(total/divisor) to get the whole-unit half of the same split.

4

For row banding, use it inside a conditional-formatting formula rule rather than in a cell.

Ctrl+CthenCtrl+Shift+V+Cthen+Ctrl+VPaste values · WindowsMac

Need it as an auditable file?

Ships inside the linked template — formula-driven, unlocked, audit-ready.

View template

What this does

MOD returns what is left after dividing. Two uses dominate in practice: extracting a remainder alongside INT (minutes left over after whole hours, items left over after full boxes), and testing for a repeating pattern. =MOD(ROW(), 2)=0 is true on every even row, which is the standard conditional-formatting rule for banding a table. Its result takes the sign of the divisor, not the dividend, which surprises people coming from other languages: =MOD(-1, 3) returns 2 in Excel. A divisor of zero returns #DIV/0!. Keep the inputs visible and clearly labelled and the whole thing stays auditable — anyone who opens the file later, including you, can see at a glance exactly what feeds the result and change one assumption without hunting through the formula. Treat “mod formula excel” as a small repeatable workflow rather than a one-off click you hope to remember next time. Use a small test block before the live file, so any surprise in the affected formula shows up while it is still harmless. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That turns a calculation you can defend to a CFO or an auditor into a method you can reuse, explain, and defend when the workbook leaves your screen.

A worked example

After =INT(197/60) gives 3 whole hours, =MOD(197, 60) returns the leftover 17 minutes. To shade every third row, apply a conditional-formatting rule of =MOD(ROW(),3)=0. To test whether a quantity divides evenly into cases of 12, =MOD(A2,12)=0 returns TRUE only when there is no partial case. MOD is the one function that answers both "what is left over" and "is this the nth item", which covers remainders, cycles and every alternating-format rule. A practical tip before you scale it up: build it once on a small block of test data, confirm the number against the tool on this page, and only then point it at your real sheet. That one habit catches almost every mistake while it is still cheap to fix, long before a wrong figure reaches a report or a colleague.

In Google Sheets

If you are in Google Sheets rather than Excel, the good news is that the formula shown here is identical and the workflow barely changes — menus sit across the top instead of in a ribbon, and a few function names differ slightly, but anything you build here moves across with little or no rework. Keep this page bookmarked for the next time the same question comes up. Better still, repeat the steps once in your own workbook — doing it yourself is what turns a copied answer into something you remember. Treat “mod formula excel” as a small building block rather than a chore. Once the inputs sit in their own cells and the formula reads from them, the same setup answers a dozen related questions with a tweak, and Excel keeps every dependent figure current as the data changes. The tool above is there so you can rehearse and verify before committing anything to a real workbook; the steps and worked example are there so the logic sticks. Get it right once and it stops costing you time — it starts saving it, every time the question comes back around.

Common mistakes

  • Expecting a negative result from a negative dividend — MOD takes the sign of the divisor, so =MOD(-1, 3) is 2, not -1.
  • A divisor of 0, which returns #DIV/0!.
  • Using MOD for banded row colours on a real Excel Table, where the built-in banded-rows style already does it and survives sorting.

Frequently asked questions

How do I find the remainder of a division?

=MOD(A2, B2) returns what is left over. =QUOTIENT(A2, B2) returns the whole-number part of the same division.

How do I highlight every other row?

Add a conditional-formatting rule with the formula =MOD(ROW(),2)=0 and set a fill. On an Excel Table, prefer the built-in banded-row style.

Why is MOD(-1, 3) equal to 2?

Excel's MOD follows the divisor's sign, so the result is always between zero and the divisor. Many programming languages instead follow the dividend and would return -1.