# MOD function in Excel

> MOD returns the remainder after dividing one number by another.

Source: https://spreadsheetpractice.com/functions/mod · Updated October 28, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

## Quick answer

- **What it does:** MOD returns the remainder after dividing one number by another.
- **Syntax:** `=MOD(number, divisor)`
- **Most common use:** `=MOD(A2,B2)` returns 1 (Remainder 1 when divided by 2, so 17 is odd)
- **Available in:** Every current version
- **Category:** [Math functions](https://spreadsheetpractice.com/functions/category/math)
- **Returns:** The remainder, with the same sign as divisor.
- **Google Sheets:** Works the same in Google Sheets.

## What it does

MOD returns the remainder after dividing one number by another. It answers questions like "how many units are left after filling full cases?", "is this number odd?" and "is this every third row?". The result always has the same sign as the divisor.

## Syntax

`=MOD(number, divisor)`

| Argument | Required? | What it is |
|---|---|---|
| `number` | Required | The number to divide. |
| `divisor` | Required | The number to divide by. It can't be 0. |

## Examples

Each result was calculated by running the formula on the sample sheet.

| Cell | Formula | Result | What it shows |
|---|---|---|---|
| C2 | `=MOD(A2,B2)` | 1 | Remainder 1 when divided by 2, so 17 is odd |
| C3 | `=MOD(A3,B3)` | 10 | Units left after filling cases of 24: 10 |
| C4 | `=MOD(A4,B4)` | 2 | The result takes the divisor's sign: -7 mod 3 is 2, not -1 |

### The sample sheet

Every formula above runs on this data:

|  | A | B | C |
|---|---|---|---|
| 1 | Value | Divisor | Remainder |
| 2 | 17 | 2 | 1 |
| 3 | 130 | 24 | 10 |
| 4 | -7 | 3 | 2 |

## Common mistakes

| What you see | Why, and how to fix it |
|---|---|
| #DIV/0! | The divisor is 0 or an empty cell. Check the second argument. |
| Unexpected result with negative numbers | MOD follows the sign of the divisor, so MOD(-7,3) is 2. Use =A2-TRUNC(A2/B2)*B2 for a remainder that follows the number's sign. |
| Tiny decimals instead of 0 | Dividing decimals can leave rounding noise such as 1E-16. Wrap the result in ROUND(…,10) before testing it. |

## Tips

- Shade every other row with a conditional formatting rule: =MOD(ROW(),2)=0.
- Get just the time from a date-time with =MOD(A2,1).

## Related functions

- [INT](https://spreadsheetpractice.com/functions/int): INT rounds a number down to the nearest whole number.
- [ISEVEN](https://spreadsheetpractice.com/functions/iseven): ISEVEN returns TRUE when a number is even.
- [ISODD](https://spreadsheetpractice.com/functions/isodd): ISODD returns TRUE when a number is odd.
- [ROUNDDOWN](https://spreadsheetpractice.com/functions/rounddown): ROUNDDOWN always rounds toward zero, dropping the extra digits whatever they are.

## Questions

### How do I check if a number is even in Excel?

Use =MOD(A2,2)=0, which returns TRUE for even numbers. ISEVEN(A2) does the same.

### What does MOD do in Excel?

It returns the remainder after division: =MOD(10,3) is 1 because 3 goes into 10 three times with 1 left over.

### How do I get the whole number and remainder separately?

Use =INT(A2/B2) for the whole part and =MOD(A2,B2) for what's left.

## Practice

A graded MOD exercise ("Loose units") is on [the MOD page](https://spreadsheetpractice.com/functions/mod). It is checked instantly, then re-checked on changed data.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
