MOD function

Excel MOD Function is a mathematical function used to find the remainder when one number is divided by another. It can be a helpful tool for various applications, such as calculating cyclic patterns or distributing items evenly.


MOD(number, divisor)


numberThe numeric value for which you want to find the remainder after division.
divisorThe numeric value you want to use as the divisor.

How to Use

To use the Excel MOD function, follow the syntax: MOD(number, divisor). Here are some examples to illustrate its use:

Example 1: Finding the Remainder

In this example, MOD(17, 5) returns 2 because when you divide 17 by 5, you have a remainder of 2.

Example 2: Handling Negative Numbers

Even with negative numbers, MOD(-10, 3) will return 2, as it still calculates the remainder.

Example 3: Handling Fractions

MOD(11.5, 3) returns 2.5, as it can handle decimal numbers and provide the remainder.

Example 4: Handling Zero Divisor

If you attempt to divide by 0, Excel will return a #NUM! error, as division by zero is undefined.

Example 5: Using MOD in Conditional Formatting

You can use MOD in Excel’s Conditional Formatting to create alternating row colors in a table. For instance:

This formula will format every other row with a different color, creating a striped pattern.

Additional Information

MOD is a versatile function for calculating remainders. It can be particularly useful in scenarios like scheduling, where you need to distribute tasks evenly or in cyclic patterns.

Tomasz Decker is an Excel specialist, skilled in data analysis and financial modeling.