Excel Tutorial
Excel tutorials, quizzes & AI guides — all levels
RSS
  • Online Excel Exercises
  • Training
  • Excel Tests
  • Sitemap
  • Premium Quizzes
  • Shop
  • My account

Function MOD (Modulo) of Excel

Statistical functions
Reading time: 3 minutes
Views: 18,716

The MOD function of Excel returns the rest of a division. This function is very useful for

  • a logical test
  • the conditional formatting
  • data validation

Presentation of the MOD function of Excel

The MOD function needs two arguments

  1. Number: The number for which you want to find the remainder.
  2. Divisor: The number by which you divide

=MOD(Number, Divisor)

MOD will return the rest of the division. Is that clear? Let’s see when to use it with the following example: You are the manager of an egg company. Every day, you receive eggs, which you pack in egg packs of 6.

Put eggs in egg packs

So you have 2 important questions to solve

  1. How many boxes will I fill?
  2. How many leftover eggs will you have in the last box?

Imagine receiving 8565 eggs (the number), and you will pack them by 6 (the divisor). Answering the first question is very easy. You must divide and keep the integer part (at the end of the article you will see another solution)

=INT(8565/6)

Number of egg boxes filled

It’s for answering the second question that the MOD function is very useful.

=MOD(8565,6)

The MOD function of Excel returns the number of leftover eggs

Now, if you use a box with 12 spaces, your Excel dashboard will automatically recalculate your model

New result for 12 spaces

MOD function in a logical test

You can also use the MOD function in a logical test, like, for instance, the odd or even numbers.

  • Even numbers are 0, 2, 4, 6, 8, 10, …..
  • Odd numbers are 1, 3, 5, 7, 9, 11, …..

There is always a step of 2 units between each number. So, a division by 2 will return 0 or 1

The division by 2 returns always 0 or 1

And we can convert the formula to a logical test like this

  • =MOD(A2,2)=0 for the Even Number
  • =MOD(A2,2)<>0 for the Odd Number
Convert the formula into a logical test

Now, you can use your test, either with the IF function, or in a conditional formating rules.

For instance, in this example, we have used exactly the same test as cutom rules and only the Even numbers are colored

Highlight the even numbers in the cells

QUOTIENT function

For the very first example, we have calculate the number of boxes with a division inside the INT function.

But we could also returned the same result with the QUOTIENT function

=QUOTIENT(B1,B2) = INT(B1/B2) =>1427

QUOTIENT function in Excel

Related articles

  • TOP 10 Most Useful Statistics Excel Functions for Data Analysis
  • Function XOR in Excel
  • Round to 10, 25, or 50 cents with Excel
  • Rounding to the Nearest Tenth or Hundredth with Excel

Frédéric LE GUEN

INT, MOD, QUOTIENT

1 Comment

  1. Brad R
    17/03/2018 @ 06:36

    Hi ,Could you please advise if it is possible to reference a date with a value to be repeated by frequency,( ie 7 days, 30, 90 days,180 days) from that date using Mod & IF syntax nested
    Thanks
    Brad

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Most Viewed Posts

  • Displaying Negative Numbers in Parentheses in Excel (310,065)
  • Top 10 Excel Functions You Must Know (232,001)
  • How to make automatic calendar in Excel (212,775)
  • Dash for a zero in Excel automatically (190,813)
  • Converting a Date from YYYYMMDD to DD/MM/YYYY in Excel (171,034)
image excel exercises
Excel Exercises
image excel quizzes
Excel Quizzes

Function MOD (Modulo) of Excel

Reading time: 3 minutes
Views: 18,716

The MOD function of Excel returns the rest of a division. This function is very useful for

  • a logical test
  • the conditional formatting
  • data validation

Presentation of the MOD function of Excel

The MOD function needs two arguments

  1. Number: The number for which you want to find the remainder.
  2. Divisor: The number by which you divide

=MOD(Number, Divisor)

MOD will return the rest of the division. Is that clear? Let’s see when to use it with the following example: You are the manager of an egg company. Every day, you receive eggs, which you pack in egg packs of 6.

Put eggs in egg packs

So you have 2 important questions to solve

  1. How many boxes will I fill?
  2. How many leftover eggs will you have in the last box?

Imagine receiving 8565 eggs (the number), and you will pack them by 6 (the divisor). Answering the first question is very easy. You must divide and keep the integer part (at the end of the article you will see another solution)

=INT(8565/6)

Number of egg boxes filled

It’s for answering the second question that the MOD function is very useful.

=MOD(8565,6)

The MOD function of Excel returns the number of leftover eggs

Now, if you use a box with 12 spaces, your Excel dashboard will automatically recalculate your model

New result for 12 spaces

MOD function in a logical test

You can also use the MOD function in a logical test, like, for instance, the odd or even numbers.

  • Even numbers are 0, 2, 4, 6, 8, 10, …..
  • Odd numbers are 1, 3, 5, 7, 9, 11, …..

There is always a step of 2 units between each number. So, a division by 2 will return 0 or 1

The division by 2 returns always 0 or 1

And we can convert the formula to a logical test like this

  • =MOD(A2,2)=0 for the Even Number
  • =MOD(A2,2)<>0 for the Odd Number
Convert the formula into a logical test

Now, you can use your test, either with the IF function, or in a conditional formating rules.

For instance, in this example, we have used exactly the same test as cutom rules and only the Even numbers are colored

Highlight the even numbers in the cells

QUOTIENT function

For the very first example, we have calculate the number of boxes with a division inside the INT function.

But we could also returned the same result with the QUOTIENT function

=QUOTIENT(B1,B2) = INT(B1/B2) =>1427

QUOTIENT function in Excel

Related articles

  • TOP 10 Most Useful Statistics Excel Functions for Data Analysis
  • Function XOR in Excel
  • Round to 10, 25, or 50 cents with Excel
  • Rounding to the Nearest Tenth or Hundredth with Excel
Tags: INTMODQUOTIENT

Frédéric LE GUEN

1 Comment

  1. Brad R
    17/03/2018 @ 06:36

    Hi ,Could you please advise if it is possible to reference a date with a value to be repeated by frequency,( ie 7 days, 30, 90 days,180 days) from that date using Mod & IF syntax nested
    Thanks
    Brad

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Contact us
About me 
Privacy Policy

© 2022 – 2026 – excel-tutorial.com. All Rights Reserved.
Excel Tutorial is managed by majordome du net

Contact us
About me 
Privacy Policy

© 2022 – 2026 – excel-tutorial.com. All Rights Reserved.
Excel Tutorial is managed by majordome du net