How to find the remainder of a division in Excel
Formula (Excel and Google Sheets)
=MOD(B2,C2)Use MOD: =MOD(B2,C2) returns what is left over after dividing B2 by C2.
- Result on the example
- one result per row in
D2, filled down toD6 - Works in
- Every current version
- Google Sheets
- Same formula
See it work
The formula is already in D2, filled down to D6. Change any input and the result updates, or edit the formula to experiment.
How it works
MOD divides the first number by the second and returns the remainder. 30 students in teams of 4 make 7 full teams with 2 left over; 24 in teams of 6 leaves nothing, so MOD returns 0.
=MOD(B2,C2)Result2
B230The value in B2.
C24The value in C2.
MOD(B2,C2)2MOD: Remainder after division.- number
B230 - divisor
C24
- number
In Google Sheets
The same formula works in Google Sheets: =MOD(B2,C2). We ran it in Google Sheets mode on the same data and it returns the same results.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =B2-C2*INT(B2/C2) | 2, 1, 0… | The definition of MOD written out: the number minus the full teams times the team size. |
Common mistakes
- MOD returns #DIV/0! when the divisor is 0 or blank.
- With negative numbers the result takes the sign of the divisor:
=MOD(-7,3)is 2, not -1.
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Find the remainder of a division
D2, work out how many students are left over after making full teams, then fill down to D6.Questions
How do I get the whole number of teams?
Use =INT(B2/C2), or =QUOTIENT(B2,C2), which drops the remainder.
How do I check if one number divides another evenly?
Test the remainder: =MOD(B2,C2)=0 returns TRUE when it divides exactly.
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.