
π This article includes 1 downloadable practice file β
In this article
- Syntax & Parameter Breakdown
- Where You Will Use It
- Practical Worked Examples
- Mistakes People Make & How to Avoid Them
- Frequently Asked Questions
- How does MOD handle negative divisors?
- How do you extract just minutes from a decimal hour value?
- Can MOD be used in VBA as well?
- MOD in practice
- Where you will use it
- Worked example
- Mistakes people make
- Continue learning
The MOD function in Excel is an essential spreadsheet tool designed to Calculate the remainder after dividing a number by a divisor, powering alternating row formatting, time calculations, and cyclic patterns.
Syntax & Parameter Breakdown
=MOD(number, divisor)
| Argument | Requirement & Description |
|---|---|
number |
Required. The numeric value you want to divide (the dividend). |
divisor |
Required. The number by which you want to divide. |
Where You Will Use It
Used to split elapsed hours and minutes, create conditional formatting rules for alternating rows, and group transactional items into batches.
Practical Worked Examples
Here are common real-world formula scenarios utilizing MOD:
| Formula | Expected Behavior & Purpose |
|---|---|
=MOD(ROW(), 2) = 0 |
Conditional formatting formula that highlights every even row in a table. |
=MOD(End_Time - Start_Time, 1) |
Calculates elapsed time accurately even when working shifts cross midnight. |
=MOD(A2, 5) = 0 |
Identifies if a number in cell A2 is an exact multiple of 5. |
Mistakes People Make & How to Avoid Them
Dividing by zero (=MOD(A2, 0)) triggers a #DIV/0! error. In Excel, the sign of the result matches the sign of the divisor.
Frequently Asked Questions
How does MOD handle negative divisors?
Excel’s MOD function follows the mathematical floor definition: the result always carries the same sign as the divisor.
How do you extract just minutes from a decimal hour value?
Use =MOD(A2, 1) * 60 to convert the fractional part of an hour into exact minutes.
Can MOD be used in VBA as well?
Yes, VBA has a native Mod operator: Result = Number Mod Divisor.
π Master spreadsheet formulas with our Free Excel Course or explore related functions in the Formula Lab.
Test formulas dynamically in our web formula laboratory or download the companion Excel workbook.
MOD in practice
Where you will use it
- Alternate row shading
- Odd/even checks
- Minutes left after full hours
Worked example
| Number | Divisor | Formula | Result |
|---|---|---|---|
| 17 | 5 | =MOD(A2,B2) | 2 |
| -7 | 3 | =MOD(A3,B3) | 2 |
| 125 | 60 | =MOD(A4,B4) | 5 |
Results calculated in Excel.
Mistakes people make
| Mistake | What to do instead |
|---|---|
| Negative numbers | MOD takes the sign of the divisor: MOD(-7,3)=2 |
| Floating point | MOD(0.3,0.1) is not 0; ROUND first |
π Practice files for this article
- πPractice workbook: Math & rounding24 tasks on realistic sales data β type your formula, the Check column turns green when it is right. Answers sheet included.β¬ XLSX Β· 35 KB
Free to use for learning. Files with macros (.bas) are plain text β import them with Alt+F11 β File β Import File, and always test on a copy.
Atul (AJ) builds office-automation and local-first AI tools as Atulya AI, and works with Excel, SAP and Oracle EPM every day. He writes about the shortcuts, macros and automations that actually save time β plus the occasional wacky fact. Videos on YouTube: Lazy Automator AI (@LazyAutomatorAI).
More posts by Atul βBuild this skill next
This page is a quick function reference. Use it for syntax, then practise the function in a broader workflow.
Stuck on a step? Ask a question and the AI answers using this article.