Math
MOD
Definition
MOD returns the remainder after a number is divided by a divisor.
Syntax
=MOD(number, divisor)
Arguments
| Argument | Meaning |
|---|---|
number |
The value to divide, or the cell holding it. |
divisor |
The number to divide by, such as 4. |
Worked example
A packing line groups jars in boxes of 4 and needs the leftover count. Counts are in A2:A4.
| A: Jars |
|---|
| 11 |
| 8 |
| 5 |
Formula: =MOD(A2,4)
Result: 3. 11 is 2 groups of 4 with 3 left over. Filled down, the formula gives 3, 0, and 1.
Practice
Cell A2 holds 10 and cell B2 holds 3. In C2, write a formula that returns the remainder of A2 divided by B2.
- In C2, write a MOD formula that returns the remainder of A2 divided by B2.
- C2 should show A2 modulo B2.
Step 1 of 2
Enter =MOD(A2,B2) in C2.
A2 is 10 and B2 is 3, so the remainder is 1.
Formulas here use English function names, such as SUM, and a period as the decimal separator, in every language.
Loading the sheet…
C2 uses MOD.
C2 now shows 1.
Related functions
ABS can take the magnitude before you take a remainder. ROUND is for digits, not leftovers after division.
Common mistake
Swapping the arguments, as in =MOD(3,A2) when A2 is 10: that returns 3, the remainder of 3 divided by 10, not of 10 divided by 3.