The MOD returns the remainder after division of number by divisor, preserving the sign of the divisor.
Syntax
MOD(number; divisor)
Arguments
| Parameter | Requirement | Valid Input |
| number | Required | Any real number (dividend) |
| divisor | Required | Non-zero real number |
Key Properties
- Mathematical Definition:

-
- Sign Rule: Result carries the sign of divisor.
- Special Case: MOD(n, 1) returns the decimal part of n.
- Error Handling:
- #DIV/0! if divisor = 0.
- Behavior for Negatives:
| Example | Result | Explanation |
| =MOD(7,3) | 1 | Standard case |
| =MOD(-7,3) | 2 | Follows divisor’s sign (+) |
| =MOD(7,-3) | -2 | Follows divisor’s sign (–) |
| =MOD(-7,-3) | -1 | Follows divisor’s sign (–) |
Examples
The MOD() function is often used together with other functions; for example, to add every second line (see Figure below).

The formula is {=SUM(IF(MOD(ROW(C3:C8);2)=0;C3:C8;0))}. Because this is an array formula, you have to press Ctrl+Page Up+Enter after you enter the formula.
Comparison with Other Methods
| Method | Formula | -7 mod 3 | Sign Rule |
| Excel MOD | n – d*INT(n/d) | 2 | Matches divisor |
| Symmetrical | n – d*TRUNC(n/d) | -1 | Matches dividend |
Applications
- Alternate Row Shading:
=MOD(ROW(),2)=0 → Conditional formatting rule
- Time Calculations: Convert seconds to HH:MM:SS.
- Circular Buffers: Index wrapping in programming.