MOD Function – Google Sheets

The function help for the MOD function
MOD Function

The MOD function in Google Sheets returns the remainder after dividing one number by another. MOD is short for modulo, another word for the remainder in a division equation.

Syntax

The syntax for this function is:

=MOD(dividend,divisor)

  • dividend – The number to be divided
  • divisor – The number to divide by

Related Functions

There are a few other functions that are related to the MOD function.

DIVIDE – Divides two numbers

QUOTIENT – Returns the quotient of a division operation

Insert Math Symbols (Add-On)

Web banner showing math symbols from the Insert Special Characters Add-On
Insert Any Math Symbol with One Click

MOD Function Examples

Here are some examples of how to use the MOD function:

Example 1 – Find the Remainder of 10 Divided by 3

First, let’s find the remainder of 10 divided by 3:

Using MOD to find the remainder of 10 divided by 3
Remainder of Division

=MOD(10,3)

You can use the MOD function to find the remainder of a division operation or to check if a number is divisible by another number. For example, the preceding formula returns 1, because 10 divided by 3 has a remainder of 1.

See the image below for a reminder of what each number in a division equation is called. The remainder is also referred to as modulo.

Illustration of the division problem
Modulo

Example 2 – Check if a Number is Divisible by Another Number

Next, we’ll use this function to evaluate two numbers and return a text string telling us if they are divisible.

Using MOD to determine if one number is divisible by another
If a Number is Evenly Divisible

The formula in C2 is: =IF(MOD(A2,B2)=0,"Divisible","Not divisible")

This formula will return β€œDivisible” if the number in column A is divisible by the divisor in column B and β€œNot divisible” if it is not.

Example 3 – Determining Odd or Even with the MOD Function

Let’s get creative now and determine if numbers are even or odd by dividing them by two.

Using MOD to determine if a number is even or odd
Even or Odd

The formula is B2 is =IF(MOD(A2,2)=0,"Even","Odd")

This formula returns β€œEven” if the number in cell A2 is even and β€œOdd” if it’s odd.

Example 4 – Performing a Calculation in Only Odd Rows

Lastly, let’s perform calculations only when the row number is odd.

Using MOD to perform an equation in every other row
Performing a Calculation Only in Odd Rows

The formula in C2 is: =IF(MOD(ROW(),2)=0,"",(A2*B2))

This formula multiplies column A’s number by column B’s number only for odd-numbered rows. For example, in row 2, the multiplication operation is skipped becuase mod outputs 0.

Live Examples in Google Sheets

You can also make a copy of the spreadsheet with these examples to use the function in your work.

Video Tutorial

YouTube player

Conclusion

In conclusion, the MOD function is a versatile tool you can use to perform various calculations needing the remainder of a division equation. By understanding the usage of the MOD function, you can use it to your advantage in your spreadsheets.