Quick Answer

MOD Function

Returns the remainder after division, with the sign of the divisor.

✓ Excel✓ Google SheetsExcel All versions

Syntax

MOD
(number, divisor)

Parameters

ParameterDescriptionRequired
numberThe dividend, the number to be divided.Required
divisorThe number by which to divide. Cannot be 0.Required

Basic Example

Remainder of 3 divided by 2

=MOD(3, 2)
Result1

3 = 1×2 + 1, so the remainder is 1.

Advanced Examples

Example 1: Negative dividend, positive divisor

Signs differ.

The result takes the divisor's (positive) sign.

=MOD(-3, 2)
Result: 1
MOD(-3,2) = -3 - 2×INT(-3/2) = -3 - 2×(-2) = 1, a positive remainder.

Example 2: Positive dividend, negative divisor

The divisor is negative.

The result takes the divisor's (negative) sign.

=MOD(7, -3)
Result: -2
MOD(7,-3) = 7 - (-3)×INT(7/-3) = 7 - (-3)×(-3) = 7 - 9 = -2.

How MOD Works

MOD computes number - divisor × INT(number / divisor). Because it uses INT, the result always has the same sign as the divisor, unlike a simple remainder that is always non-negative.

1
Select the cell
Click the cell for the result.
2
Enter the formula
Type =MOD(number, divisor).
3
Press Enter
The remainder appears.

Important Notes & Limitations

  • The divisor cannot be 0; MOD(n, 0) returns #DIV/0!.

  • The result's sign follows the divisor, which can be counter-intuitive (MOD(-3,2)=1).

  • Results are floating-point; tiny rounding may appear with non-integer inputs.

Common Errors & Fixes

#DIV/0!The divisor is 0.

Fix: Use a non-zero divisor.

Unexpected signForgetting the result follows the divisor's sign.

Fix: Apply ABS if you need a non-negative remainder, or adjust signs intentionally.

Download Practice File

Practice MOD with Real Data

Download a sample CSV file with pre-populated data and practice exercises for the MOD function. Works in both Excel and Google Sheets.

Works in Google SheetsCompatible with ExcelIncludes exercises

File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps

Frequently Asked Questions

Why is MOD(-3, 2) equal to 1?
MOD returns a result with the same sign as the divisor. Since the divisor 2 is positive, the remainder is positive 1.
Is MOD the same as a programming remainder?
Not always. In many languages '%' gives a sign matching the dividend; Excel's MOD matches the divisor.
How do I get a non-negative remainder?
Wrap with ABS: =ABS(MOD(number, divisor)), or use MOD(MOD(number, d)+d, d) to keep it in [0, d).