MOD Function

Excel Functions › Math & Trig

All versions Math & Trig

The Excel MOD function returns the remainder after one number is divided by another. In Excel the result always takes the sign of the divisor — a key difference from many programming languages.


Quick answer:
=MOD(10,3) = 1

Syntax

=MOD(number, divisor)
ArgumentDescription
numberRequiredThe number to be divided (the dividend).
divisorRequiredThe number to divide by. If 0, MOD returns a #DIV/0! error.

How to use it

MOD gives you what is left over after integer division. =MOD(10,3) is 1 because 10 = 3×3 + 1.

=MOD(10,3) // remainder = 1
=MOD(9,3) // divides evenly = 0
=MOD(-10,3) // sign follows divisor = 2

A classic use is testing for even/odd or every-Nth: =MOD(row,2)=0 flags even rows for banded shading. To round to multiples, MOD partners with QUOTIENT, which returns the whole-number part of the same division.

The sign gotcha: Excel's MOD result takes the sign of the divisor, not the dividend. So =MOD(-10,3) returns 2 (not -1). Excel computes number - divisor*INT(number/divisor). If you want a result that follows the dividend instead, compute it from QUOTIENT.

Try it: interactive demo

Live demo

Pick a MOD example to see the formula and its result.

Result:

Practice workbook

📊
Download the free MOD practice workbook
Every example on this page, ready to open in Excel — plus practice challenges with answers on a separate tab. No sign-up required.

Frequently asked questions

Why does MOD(-10,3) return 2 instead of -1?
Because Excel's MOD takes the sign of the divisor. It computes number - divisor*INT(number/divisor), so with a positive divisor the remainder is always positive. =MOD(-10,3) = 2.
How do I test for even or odd with MOD?
Use =MOD(n,2): it returns 0 for even numbers and 1 for odd. (Excel also has dedicated ISEVEN and ISODD functions.)
What happens if the divisor is zero?
MOD returns a #DIV/0! error, just like ordinary division by zero. Guard against it with IF or IFERROR.
How is MOD related to QUOTIENT?
They split a division: QUOTIENT gives the whole-number part and MOD gives the remainder. In general number = divisor*QUOTIENT(number,divisor) + remainder (though MOD's sign convention can differ for negatives).

Master functions like this in one day

This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related functions: QUOTIENT · INT · ROUND · MROUND · ABS