MODfunction returns the remainder of a division operation. It takes two numeric inputs: the dividend and divisor. The result will be the remainder after the dividend has been divided by the divisor. This function is often used in financial and accounting calculations.
- How to use
- Examples of using
MODformula not working?
- Similar formulas to
MOD formula with the syntax shown below, it has 2 required parameters:
- dividend (required):
The value to be divided.
- divisor (required):
The value to divide by.
ExamplesHere are a few example use cases that explain how to use the
MODformula in Google Sheets.
The MOD function can be used to determine the remainder of a division operation. For example, if you want to know if a number is odd or even, you can use the MOD function to find the remainder after dividing by 2. If the remainder is 0, the number is even. If the remainder is 1, the number is odd.
If you want to find the quotient of a division operation, you can use the QUOTIENT function in conjunction with MOD. For example, if you want to divide 10 by 3 and get the result as a whole number with the remainder, you can use the formula =QUOTIENT(10,3) & " remainder " & MOD(10,3). This will return the result "3 remainder 1".
Cyclic Number Sequences
The MOD function can be used to create cyclic number sequences. For example, if you want to create a sequence of numbers that cycles between 1, 2, and 3, you can use the formula =MOD(ROW()-1,3)+1. This will return the sequence 1, 2, 3, 1, 2, 3, and so on, as you fill down the formula.
MODnot working? Here are some common mistakes people make when using the
MODGoogle Sheets Formula:
Divisor is zero
If the divisor is zero, the MOD function will result in a #DIV/0! error. Ensure that the divisor is not zero.
The MOD function only works with numeric inputs. If non-numeric inputs are provided, the function will result in a #VALUE! error. Ensure that both inputs are numeric.
Dividend is negative
If the dividend is negative, the MOD function will return a negative remainder. If a positive remainder is required, add the divisor to the result until it is positive.
The following functions are similar to
MOD or are often used with it in a formula:
QUOTIENTformula in Google Sheets returns the integer portion of a division operation. It takes two parameters, the
divisor. The formula divides the
divisorand returns the quotient without the remainder.
SUMfunction in Google Sheets adds up a range of numbers. This function is most commonly used to sum the values in a range of cells.
PRODUCTformula in Google Sheets multiplies all the numbers given in the arguments and returns the product. It is commonly used to calculate the total product of a range of cells.
ROUNDformula rounds a number to a specified number of decimal places. It is commonly used to simplify large numbers or to make a number more readable. The formula can round both positive and negative numbers. If the
placesparameter is not specified, the formula rounds to the nearest integer.
CEILINGfunction returns a number rounded up to the nearest multiple of a specified factor. It is commonly used to round up prices to the nearest dollar or to adjust numbers to fit into specific increments.
You can learn more about the
MOD Google Sheets function on Google Support.