# How to find the remainder of a division in Excel

Use MOD: `=MOD(B2,C2)` returns what is left over after dividing B2 by C2.

**Excel:** `=MOD(B2,C2)` (Every current version)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C | D |
| --- | --- | --- | --- |
| Class | Students | Team size | Left over |
| Period 1 | 30 | 4 |  |
| Period 2 | 31 | 5 |  |
| Period 3 | 24 | 6 |  |
| Period 4 | 27 | 4 |  |
| Period 5 | 34 | 8 |  |

Formula in D2, filled to D6: `=MOD(B2,C2)`

Result: 2; 1; 0; 3; 2

## 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.

## Other ways

- `=B2-C2*INT(B2/C2)`: 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.

## 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.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/remainder-of-a-division
