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.

MOD is useful whenever the remainder itself carries meaning. It shows up in cycle logic, periodic grouping, alternating patterns, and rules where the workbook needs to know what is left over after division instead of only the quotient.

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.

This is a useful starting example because it shows what MOD really gives back: not the quotient, but the leftover amount that did not fit into a full group.

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

In cell D2, find the remainder after dividing the first number by the divisor.

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.

This makes the example practical because it turns a small arithmetic rule into a readable worksheet decision. MOD is doing the numeric test, and IF turns that into something easy to interpret.

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

In cell D3, use MOD with IF to label the value as even or 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.

This is helpful when the sheet needs a clean yes-or-no answer. The formula is checking whether the value fits the interval perfectly without any remainder left over.

=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!D4

In cell D4, check whether the value divides evenly by the divisor.

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.

That gives the function another practical use beyond divisibility. It can also separate the decimal part of a value when that fractional piece has meaning on its own.

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

In cell D5, use MOD with 1 to isolate the decimal part.

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

MOD is a small function with a lot of everyday uses because it gives you the leftover part after division. In this lesson, that leftover was the key to checking even and odd numbers, testing exact multiples, and working with repeating patterns.

The examples also showed that MOD is not only about whole numbers. It can pull out the decimal part of a value, and in other formulas it can help wrap times or cycles back to the start. If a rule repeats after a fixed interval, MOD is often the easiest tool to start with.

  • 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
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.