MOD Function

MOD Function

MOD Function

Returns the remainder after division. MOD is useful for divisibility tests, repeating cycles, alternating-row logic, and time calculations that wrap across midnight.

ExcelClash Team
PUBLISHED

Summary

The Excel MOD function returns the remainder after one number is divided by another. For example, =MOD(10,3) returns 1 because 3 fits into 10 three times, leaving 1 unused. When the division is exact, MOD returns 0, which is why the function is so effective in divisibility tests.

Although the arithmetic idea is simple, MOD supports a wide range of worksheet logic. It is used for odd-even testing, repeating sequences, cycle-based grouping, alternating row formatting, and time calculations that need to wrap back into a 24-hour day. Whenever a rule repeats after a fixed interval, MOD is often the function behind it.

Purpose

Return the remainder after division

Gives the leftover amount after full multiples of the divisor have been removed. Often used in divisibility logic, cyclic patterns, and row-banding formulas.

Return Value

A remainder

Returns the remainder with the same sign as the divisor. If the divisor is zero, Excel returns #DIV/0!.

Syntax

=MOD(number, divisor)

MOD takes two required arguments. number is the value being divided, and divisor is the value used to divide it. The result is the part that remains after all full multiples of the divisor have been removed. Microsoft also describes the function algebraically as MOD(n,d)=n-d*INT(n/d), which explains why INT and MOD are closely related.

Arguments

  • number - [Required] The dividend, or the value you want to divide.
  • divisor - [Required] The value used to divide the number. It cannot be zero.

MOD vs Other Functions

MOD is often paired with QUOTIENT and INT because all three describe different aspects of division. Choosing the right one depends on whether you need the leftover amount, the whole-number count, or a rounded result.

Function What It Returns Example with 10 and 3 Use When
MOD Remainder 1 You need the leftover part or a repeating pattern test
QUOTIENT Integer portion of the division 3 You need the count of full groups without the remainder
INT Rounded-down integer result 3 from 10/3 You need the floor of a numeric result, especially in broader formulas
ISEVEN / ISODD TRUE or FALSE Odd/even classification You only need a direct boolean test rather than the remainder itself

MOD is the more flexible option when the remainder itself has meaning. A zero remainder means exact divisibility, a remainder of 1 in a modulus-2 test identifies odd numbers, and any repeating sequence can be modeled by checking the remainder against a fixed interval.

Using MOD

The most common worksheet pattern is a divisibility test. A formula such as =MOD(A1,2)=0 checks whether a value divides evenly by 2, and therefore whether it is even. The same structure works for any divisor, which makes MOD a compact way to test packaging rules, schedule cycles, or numeric classification logic.

MOD is also valuable in time arithmetic. If a shift starts late at night and ends after midnight, a direct subtraction can produce a negative result unless dates are included. Wrapping the subtraction in MOD(end_time-start_time,1) forces the result back into one-day range, which is why MOD is a standard fix for overnight-duration formulas.

  • Use MOD(n,2) when odd-even status matters.
  • Use MOD(n,batch_size)=0 to test whether a quantity fits exact group sizes.
  • Use MOD(end-start,1) to handle elapsed time that crosses midnight.
  • Use MOD(value,1) to isolate the fractional part of a positive decimal value.

Example 1 - Get the Remainder After Division

This example shows the core behavior directly. MOD returns the unused portion after all full groups have been taken out. With 10 divided by 3, the whole groups account for 9 and the remainder is 1.

=MOD(10,3)   // 1
=MOD(12,3)   // 0
=MOD(14,5)   // 4
Check Answer
Challenge #1
Target: Sheet1!F1
Basic Remainder

In cell F1, use MOD to find the remainder when 10 is divided by 3. Expected result: 1.

Example 2 - Check if a Number Is Even or Odd

Dividing by 2 creates a binary remainder pattern. Even numbers leave 0, odd numbers leave 1. Wrapping that test in IF converts the remainder into a label that can be displayed directly in a report or helper column.

=IF(MOD(B2,2)=0,"Even","Odd")
// B2 = 7
// MOD(7,2) = 1, so the result is "Odd"
Check Answer
Challenge #2
Target: Sheet1!F2
Even or Odd Check

In cell F2, use IF and MOD on B2 to label it "Even" or "Odd". B2 contains 7. Expected: "Odd".

Example 3 - Check Whether a Value Divides Evenly

A zero remainder means the number is an exact multiple of the divisor. That makes MOD a direct fit for rules such as case-pack quantities, staffing rotation intervals, or payment frequencies that must align exactly with a base unit.

=IF(MOD(B3,C3)=0,"Yes","No")
// B3 = 24, C3 = 6
// MOD returns 0, so the result is "Yes"
Check Answer
Challenge #3
Target: Sheet1!F3
Check if Divisible

In cell F3, use IF and MOD to check if B3 (24) is evenly divisible by C3 (6). Expected: "Yes".

Example 4 - Extract the Decimal Part of a Number

Using 1 as the divisor removes the whole-number component and returns only the remainder after division by 1. For a positive number such as 5.75, the result is 0.75. This is a compact way to isolate the fractional component without a separate subtraction step.

=MOD(B4,1)
// B4 = 5.75
// Result = 0.75
Check Answer
Challenge #4
Target: Sheet1!F4
Extract Decimal Part

In cell F4, use MOD on B4 (5.75) with divisor 1 to extract only the decimal part. Expected: 0.75.

One subtle point is sign handling. Microsoft documents that the result has the same sign as the divisor, not necessarily the dividend. That matters in more advanced models involving negative values, because MOD(-3,2) and MOD(3,-2) do not behave the same way.

  • MOD returns #DIV/0! if the divisor is zero.
  • The remainder takes the sign of the divisor.
  • MOD pairs naturally with ROW(), COLUMN(), IF, and conditional formatting rules when a repeating pattern is needed.

Conclusion Recap

  • Summary: MOD returns the remainder after division.
  • Syntax: =MOD(number,divisor) with two required arguments.
  • Key behavior: A zero result means exact divisibility, and the sign of the remainder matches the divisor.
  • Practical usage: Divisibility tests, cyclic logic, alternating-row rules, and overnight time calculations.
Tactical Arena
Select Scenario:
Share MOD Function!

Tell your friends about this post

Discussion

ExcelClash is an interactive platform designed to level up your Excel skills through real-world exercises and challenges. Sharpen your logic, solve real spreadsheet problems, and learn faster.

© 2026 ExcelClash, Inc. All rights reserved.