MOD function

MOD returns the remainder after dividing one number by another, making it useful for identifying patterns, cycles, and divisibility in data.

=MOD(number, divisor)

Generate a MOD formula

Describe what you need. The generator will reach for MOD where MOD is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives — "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

How MOD reads its arguments
numberrequireddivisorrequiredMOD
ArgumentRequiredDescription
numberRequiredRequired. The number to divide. Can be negative; remainder sign depends on spreadsheet implementation.
divisorRequiredRequired. The number to divide by. Must be non-zero; returns #DIV/0! if divisor is zero.

Returns

A number representing the remainder after division.

Availability

Excel: All · Google Sheets: Supported

Worked examples

1. Check if a student's score is even

StudentScoreIs Even
Alice15FALSE
Bob18TRUE
Charlie23FALSE
=MOD(E2,2)=0

Result: FALSE for score 15

MOD(15,2) returns 1 (the remainder when 15 is divided by 2), which is not 0, so the formula returns FALSE. MOD(18,2) returns 0 because 18 is even, giving TRUE. Useful for flagging odd vs. even scores for review processes.

2. Rotate students through grading batches

RowStudentBatch
2Alice1
3Bob2
4Charlie3
5Diana1
=MOD(ROW()-2,3)+1

Result: Cycles 1, 2, 3, 1, 2, 3...

MOD(0,3)+1 yields 1, MOD(1,3)+1 yields 2, MOD(2,3)+1 yields 3, then MOD(3,3)+1 cycles back to 1. This distributes four students evenly across three grading batches, ensuring fair workload rotation among teachers.

3. Identify scores divisible by a target interval

StudentScoreRemainder (÷5)
Alice150
Bob183
Charlie200
Diana233
=MOD(E2,5)

Result: 0 for Alice (score 15), 3 for Bob (score 18)

MOD(15,5) returns 0 because 15 divides evenly by 5. MOD(18,5) returns 3 because 18÷5 leaves remainder 3. This helps identify which students scored milestone values (like 15, 20, 25) that might trigger bonus points.

Common errors

Which MOD error are you seeing?
MOD returned an error#DIV/0!
Ensure divisor is never zero. Wrap with IFERROR: =IFERROR(MOD(E2,B2),"N/A") to gracefully handle zero divisors.
#VALUE!
Ensure both arguments are numbers, not text. Convert with VALUE() if needed, or check that the column contains numeric data.
#REF!
Restore the deleted column, update the formula to reference valid cells, or remove stale range references.
ErrorWhy it happensHow to fix it
#DIV/0!The divisor is zero. MOD(15,0) attempts division by zero, which has no valid result.Ensure divisor is never zero. Wrap with IFERROR: =IFERROR(MOD(E2,B2),"N/A") to gracefully handle zero divisors.
#VALUE!The number or divisor argument is text instead of numeric. MOD("fifteen",2) or MOD(15,"two") will error.Ensure both arguments are numbers, not text. Convert with VALUE() if needed, or check that the column contains numeric data.
#REF!A cell reference in the formula points to a cell or range that no longer exists, such as MOD(E2,G:G) after column G is deleted.Restore the deleted column, update the formula to reference valid cells, or remove stale range references.

Tips and when to use something else

  • Combine MOD with IF to classify data: =IF(MOD(score,2)=0,"even","odd") immediately categorizes scores by divisibility.
  • Use MOD with ROW() or COLUMN() to create repeating patterns for batch assignment, group rotation, or cyclic distribution without manual input.
  • For rounding to the nearest multiple, use MROUND instead—MOD only gives the remainder, not the rounded value. MOD(17,5) gives 2; MROUND(17,5) gives 15.
  • MOD behavior with negative numbers varies by spreadsheet: Excel returns a remainder with the divisor's sign, while Google Sheets uses the dividend's sign. Always test in your platform.

Frequently asked questions

How do I check if a number is evenly divisible by another?
Use =MOD(number,divisor)=0. If it returns TRUE, the first number divides evenly. For example, MOD(20,5)=0 is TRUE because 20 is evenly divisible by 5.
When should I use MOD instead of MROUND?
Use MOD to find remainders and detect divisibility patterns. Use MROUND when you need to round a value to the nearest multiple. They answer different questions about numbers.
Can I use MOD with decimal numbers?
Yes. MOD(7.5,2) returns 1.5. Both the dividend and divisor can be decimals, though remainder interpretation is less intuitive than with whole numbers.
Why does my spreadsheet show different MOD results than a colleague's for negative numbers?
Excel and Google Sheets handle negative remainders differently. Excel returns remainder with the divisor's sign; Google Sheets uses the dividend's sign. Check your platform's documentation and test with your actual data.

Need a different formula?

The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.

Open the formula generator

Reviewed 2026-09-17