# Excel MOD function - Returns the Remainder from a Division Problem

The MOD function returns the remainder from a division problem. The remainder will always have the same sign as the divisor.

The Syntax for the MOD function is:
`= MOD(number, divisor)`
Number is the number that you are dividing.
Divisor is the number you are dividing by.

If the divisor is 0 then the function will return the error #DIV/0!

MOD Function Examples
Argument    Result Description
=MOD(12,5) 2 Twelve divided by 5 leaves a remainder of 2.
=MOD(9,3) 0 Nine is divided evenly by 3 leaving no remainder
=MOD(17,-3) -1 Because the divisor is negative the returned value is negative
=MOD(-31,7) 4 Because the divisor is positive the returned value is positive
=MOD(-31,-7)   -3 Because the divisor is negative the returned value is negative
=MOD(14,0) #DIV/0!    The error is caused because the divisor is 0.

## Practice for using the MOD function

We need to know how many egg cartons are needed to package our eggs. Each carton holds a dozen eggs. We would also like to know how many eggs will be left over that will not completely fill a carton.
1. Create a new worksheet named ChickenBiz. Enter the data as shown below. For the heading using the Informal Roman font. Change its size to 24 and bold it. Merge and Center it across columns A,B, and C. Use whatever fill color you want for the background color. Expand the row height for row 1. Expand the width of the columns to accommodate the column headings.

2. In cell B3 type the formula` =A3/12`. Press Ctrl + Enter.
3. We only want full cartons so we will need to remove the fractional part of our result. Right-click on cell B3. Select Format Cells. On the Number Tab select Number in the Category box. Change the decimal places to 0. Click on the OK button.
4. Drag the AutoFill handle down from cell B3 to B8.
5. Type the formula `=MOD(A3,12)` in cell C3. Press Ctrl + Enter.
This will return the remainder of dividing 538 by 12.
6. Drag the AutoFill handle down from cell C3 to C8.
7. The result is shown below.