
What is the MOD Function?
The MOD function returns the remainder when one number is divided by another. Widely used in Excel versions 2007, 2010, 2013, 2016 and beyond. In case there is a remainder, the MOD function will give us the remainder, otherwise it returns 0.
Additionally, we can combine the MOD function with other functions to calculate or extract remainders from the selected result.

MOD Function Formula in Excel
Syntax: =MOD(number,divisor)
Where:
- number: acts as the dividend, the number you want to find the remainder of.
- divisor: acts as the divisor.
Both number and divisor elements are mandatory values.

When using the MOD function in Excel, you need to pay attention to the following:
- When entering negative numbers (-2, -3, -4,...), parentheses must be used, for example, (-2), (-3),... otherwise the result will be incorrect.
- In the case where the divisor is 0 or empty, the MOD function will return an error result #DIV/0!.
- The result will have the same sign as the divisor (regardless of the sign of the dividend).
- The MOD function in Excel can also be expressed in terms of the quotient of the INT function, specifically: MOD(n,d) = n-d*INT(n/d).
Example of MOD Function for Remainders in Excel
To better understand how to use the MOD function for remainders in Excel, let's analyze the following examples together!

Marking Rows Using MOD Function
Let's perform the MOD calculation using the following steps!
- Step 1: In the toolbar, select Home => Click on Conditional Formatting => New Rule.
In the toolbar, follow the steps as illustrated.- Step 2: When the New Formatting Rule window appears, select Use a formula to determine which cells to format.
Select Use a formula to determine which cells to format.- Step 3: In the Edit the Rule Description, enter the following formula: =MOD(ROW(A1),3)=0.
Enter the MOD function formula in the Edit the Rule Description box.- Step 4: Click on the Format box to choose font style, font color, background color.
To change font style and colors, select the Format box.- Step 5: Choose OK to view the returned result.
View the returned result by selecting OK.Calculating Remainders of Division in Excel
We will use the MOD function for remainders in Excel at cell C2 and apply the following formula: =MOD(A2,B2). Where:
B2 is the divisor. A2 is the dividend.
Enter the formula to find the result.Then, press Enter to see the returned result.
The returned result of the remainder is 2.Explaining the result:
- The result returned by the MOD function is a remainder of 2, meaning 5 divided by 3 equals 1 with a remainder of 2.
- Due to the sign of the divisor, the result in C3 is 4, similarly in C4, C5, C6.
- At C7, the result returns an error due to the divisor being 0.
Explaining the result of the MOD divisionSo, we have learned about the MOD function for remainders in Excel and analyzed some basic examples of division. Hopefully, this information will be helpful for your work, study, and life. Don't forget to follow Mytour for more interesting news about gaming and technology!
