---
title: "MOD function in Excel: syntax and examples | ExcelSavvy"
description: "How to use MOD in Excel and Google Sheets: remainders, every n-th row and odd or even numbers."
canonical_url: "https://excelsavvy.com/functions/mod"
meta:
  "og:description": "How to use MOD in Excel and Google Sheets: remainders, every n-th row and odd or even numbers."
  "og:image": "https://excelsavvy.com/_og/d/c_Page%2Ctitle_~TU9EIGZ1bmN0aW9uIGluIEV4Y2VsOiBzeW50YXggYW5kIGV4YW1wbGVz%2Cdescription_~SG93IHRvIHVzZSBNT0QgaW4gRXhjZWwgYW5kIEdvb2dsZSBTaGVldHM6IHJlbWFpbmRlcnMsIGV2ZXJ5IG4tdGggcm93IGFuZCBvZGQgb3IgZXZlbiBudW1iZXJzLg%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~TU9EKG51bWJlciwgZGl2aXNvcik%2Cp_Ii9mdW5jdGlvbnMvbW9kIg%2Cs_iTKA6bVZ6hje_qn6.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "MOD function in Excel: syntax and examples | ExcelSavvy"
  "twitter:image": "https://excelsavvy.com/_og/d/c_Page%2Ctitle_~TU9EIGZ1bmN0aW9uIGluIEV4Y2VsOiBzeW50YXggYW5kIGV4YW1wbGVz%2Cdescription_~SG93IHRvIHVzZSBNT0QgaW4gRXhjZWwgYW5kIEdvb2dsZSBTaGVldHM6IHJlbWFpbmRlcnMsIGV2ZXJ5IG4tdGggcm93IGFuZCBvZGQgb3IgZXZlbiBudW1iZXJzLg%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~TU9EKG51bWJlciwgZGl2aXNvcik%2Cp_Ii9mdW5jdGlvbnMvbW9kIg%2Cs_iTKA6bVZ6hje_qn6.png"
---

> Index of every page on this site: [llms.txt](https://excelsavvy.com/llms.txt)

# **The MOD function**

Returns the remainder after division. The result has the same sign as the divisor.

=

MOD(

## **How to use MOD**

MOD returns what is left over after a division. Picture 10 chocolates shared among 3 children: each child gets 3, and 1 is left on the table. `**=MOD(10,3)**` is that leftover 1.

That sounds small, but it is one of the handiest functions for spotting patterns. If the remainder is 0 when you divide by 2, the number is even: `**=MOD(A2,2)=0**`. To pick out every third row, use `**=MOD(ROW(),3)=0**`, which is a common formula for coloring rows with a conditional formatting rule. `**=MOD(A2,7)**` gives the days left over after whole weeks, and `**=MOD(A2,1)**` gives the time part of a date-and-time value. To hand out a list in turns among four people, let MOD divide a running number by 4 and you get 0, 1, 2, 3, 0, 1 and so on.

The first argument is the number and the second is the divisor. The result takes the sign of the divisor, so `**=MOD(-3,4)**` gives 1 and not -3, because -3 is -1 times 4 plus 1. The divisor cannot be 0.

If you want the whole-number part of the division instead, use INT: `**=INT(10/3)**`.

## **Syntax**

```
MOD(number, divisor)
```

<dl><dt>**number **</dt>
<dd>The number to divide.</dd>
<dt>**divisor **</dt>
<dd>The number to divide by.</dd></dl>

## **Examples**

B1`=MOD(<sup>1</sup>10,<sup>2</sup>3)`

|  | A | B |
| --- | --- | --- |
| 1 |  | **1** |

**In plain words:** The remainder when <sup>1</sup>10 is divided by <sup>2</sup>3.

B1=MOD(-3,4)

|  | A | B |
| --- | --- | --- |
| 1 |  | **1** |

## **Common MOD mistakes**

- MOD returns #DIV/0!

  The divisor is 0 or an empty cell. Guard against it with `**=IF(B2=0,"",MOD(A2,B2))**`.
- The remainder of a negative number comes out positive

  MOD gives the result the sign of the divisor, not of the number. If you want the remainder to keep the number's own sign, use `**=A2-B2*TRUNC(A2/B2)**`.
- Every third row starts in the wrong place

  `**=MOD(ROW(),3)=0**` hits rows 3, 6, 9 and skips the first row. Subtract 1 first, as in `**=MOD(ROW()-1,3)=0**`, to hit rows 1, 4, 7.
- MOD returns #VALUE!

  One of the arguments is text that cannot be read as a number, such as "12 pcs". Clean the cell to a plain number, or pull the number out first, for example `**=MOD(VALUE(LEFT(A2,2)),5)**`.

## **Read the guide**

- [**Conditional formatting in Excel: highlight cells and rows with rules and formulas**](https://excelsavvy.com/learn/conditional-formatting-excel)

## **Questions**

<details>

<summary>

### How do I check whether a number is even or odd?

</summary>

Divide by 2 with MOD: =MOD(A2,2)=0 is TRUE for an even number. =IF(MOD(A2,2)=0,"Even","Odd") writes the word instead.

</details>

<details>

<summary>

### How do I shade every other row with MOD?

</summary>

Add a conditional formatting rule with a formula, such as =MOD(ROW(),2)=0 for the even rows, and pick a fill color.

</details>

<details>

<summary>

### How do I check whether one number divides evenly by another?

</summary>

=MOD(A2,B2)=0 is TRUE when B2 goes into A2 with nothing left over, for example to flag order quantities that fit full boxes.

</details>

<details>

<summary>

### How do I get the whole-number part of a division?

</summary>

Use INT or QUOTIENT instead of MOD. =INT(10/3) returns 3, while =MOD(10,3) returns the remainder 1.

</details>

## **Related functions**

- [**INT**](https://excelsavvy.com/functions/int)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://excelsavvy.com/#identity","@type":"Organization","name":"ExcelSavvy","url":"https://excelsavvy.com/","logo":{"@id":"https://excelsavvy.com/#logo"}},{"@id":"https://excelsavvy.com/#website","@type":"WebSite","inLanguage":"en-US","name":"ExcelSavvy","url":"https://excelsavvy.com/","alternateName":["Excel Savvy","ExcelSavvy.com","PracticeExcel","Practice Excel Online"],"publisher":{"@id":"https://excelsavvy.com/#identity"},"workTranslation":[{"@id":"https://excelopgaver.dk/#website"},{"@id":"https://excelpraxis.de/#website"}]},{"@id":"https://excelsavvy.com/functions/mod#webpage","dateModified":"2026-11-16","description":"How to use MOD in Excel and Google Sheets: remainders, every n-th row and odd or even numbers.","name":"MOD function in Excel: syntax and examples","url":"https://excelsavvy.com/functions/mod","@type":["WebPage","FAQPage"],"breadcrumb":{"@id":"https://excelsavvy.com/functions/mod#breadcrumb"},"isPartOf":{"@id":"https://excelsavvy.com/#website"},"mainEntity":[{"@id":"https://excelsavvy.com/functions/mod#/schema/question/1"},{"@id":"https://excelsavvy.com/functions/mod#/schema/question/2"},{"@id":"https://excelsavvy.com/functions/mod#/schema/question/3"},{"@id":"https://excelsavvy.com/functions/mod#/schema/question/4"}],"potentialAction":[{"@type":"ReadAction","target":["https://excelsavvy.com/functions/mod"]}],"primaryImageOfPage":{"@id":"https://excelsavvy.com/#logo"}},{"@id":"https://excelsavvy.com/functions/mod#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://excelsavvy.com","position":1},{"@type":"ListItem","name":"Excel functions","item":"https://excelsavvy.com/functions","position":2},{"@type":"ListItem","name":"MOD function in Excel: syntax and examples","position":3}]},{"@id":"https://excelsavvy.com/functions/mod#article","dateModified":"2026-11-16","description":"How to use MOD in Excel and Google Sheets: remainders, every n-th row and odd or even numbers.","headline":"MOD function in Excel: syntax and examples","inLanguage":"en-US","thumbnailUrl":"https://excelsavvy.com/_og/d/c_Page%2Ctitle_~TU9EIGZ1bmN0aW9uIGluIEV4Y2VsOiBzeW50YXggYW5kIGV4YW1wbGVz%2Cdescription_~SG93IHRvIHVzZSBNT0QgaW4gRXhjZWwgYW5kIEdvb2dsZSBTaGVldHM6IHJlbWFpbmRlcnMsIGV2ZXJ5IG4tdGggcm93IGFuZCBvZGQgb3IgZXZlbiBudW1iZXJzLg%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~TU9EKG51bWJlciwgZGl2aXNvcik%2Cp_Ii9mdW5jdGlvbnMvbW9kIg%2Cs_iTKA6bVZ6hje_qn6.png","@type":["Article","TechArticle"],"author":{"@id":"https://excelsavvy.com/#identity"},"image":{"@id":"https://excelsavvy.com/#/schema/image/1"},"isPartOf":{"@id":"https://excelsavvy.com/functions/mod#webpage"},"mainEntityOfPage":{"@id":"https://excelsavvy.com/functions/mod#webpage"},"publisher":{"@id":"https://excelsavvy.com/#identity"}},{"@id":"https://excelsavvy.com/functions/mod#/schema/question/1","@type":"Question","inLanguage":"en-US","name":"How do I check whether a number is even or odd?","acceptedAnswer":{"@type":"Answer","text":"Divide by 2 with MOD: =MOD(A2,2)=0 is TRUE for an even number. =IF(MOD(A2,2)=0,\"Even\",\"Odd\") writes the word instead."}},{"@id":"https://excelsavvy.com/functions/mod#/schema/question/2","@type":"Question","inLanguage":"en-US","name":"How do I shade every other row with MOD?","acceptedAnswer":{"@type":"Answer","text":"Add a conditional formatting rule with a formula, such as =MOD(ROW(),2)=0 for the even rows, and pick a fill color."}},{"@id":"https://excelsavvy.com/functions/mod#/schema/question/3","@type":"Question","inLanguage":"en-US","name":"How do I check whether one number divides evenly by another?","acceptedAnswer":{"@type":"Answer","text":"=MOD(A2,B2)=0 is TRUE when B2 goes into A2 with nothing left over, for example to flag order quantities that fit full boxes."}},{"@id":"https://excelsavvy.com/functions/mod#/schema/question/4","@type":"Question","inLanguage":"en-US","name":"How do I get the whole-number part of a division?","acceptedAnswer":{"@type":"Answer","text":"Use INT or QUOTIENT instead of MOD. =INT(10/3) returns 3, while =MOD(10,3) returns the remainder 1."}},{"@id":"https://excelsavvy.com/#logo","@type":"ImageObject","caption":"ExcelSavvy","contentUrl":"https://excelsavvy.com/brand/practiceexcel/icon-512.png?v=3","inLanguage":"en-US","url":"https://excelsavvy.com/brand/practiceexcel/icon-512.png?v=3"},{"@id":"https://excelsavvy.com/#/schema/image/1","@type":"ImageObject","contentUrl":"https://excelsavvy.com/_og/d/c_Page%2Ctitle_~TU9EIGZ1bmN0aW9uIGluIEV4Y2VsOiBzeW50YXggYW5kIGV4YW1wbGVz%2Cdescription_~SG93IHRvIHVzZSBNT0QgaW4gRXhjZWwgYW5kIEdvb2dsZSBTaGVldHM6IHJlbWFpbmRlcnMsIGV2ZXJ5IG4tdGggcm93IGFuZCBvZGQgb3IgZXZlbiBudW1iZXJzLg%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~TU9EKG51bWJlciwgZGl2aXNvcik%2Cp_Ii9mdW5jdGlvbnMvbW9kIg%2Cs_iTKA6bVZ6hje_qn6.png","inLanguage":"en-US","url":"https://excelsavvy.com/_og/d/c_Page%2Ctitle_~TU9EIGZ1bmN0aW9uIGluIEV4Y2VsOiBzeW50YXggYW5kIGV4YW1wbGVz%2Cdescription_~SG93IHRvIHVzZSBNT0QgaW4gRXhjZWwgYW5kIEdvb2dsZSBTaGVldHM6IHJlbWFpbmRlcnMsIGV2ZXJ5IG4tdGggcm93IGFuZCBvZGQgb3IgZXZlbiBudW1iZXJzLg%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~TU9EKG51bWJlciwgZGl2aXNvcik%2Cp_Ii9mdW5jdGlvbnMvbW9kIg%2Cs_iTKA6bVZ6hje_qn6.png"}]}
```

## Sitemap

See the full [sitemap](https://excelsavvy.com/sitemap.md) for all pages.
