Find the Remainder When Dividing in Excel

Formula syntax and usage of MOD

Illustration of the number 900 and all its factors

Robert Brook / Science Photo Library / Getty Images

The MOD function, short for modulo or modulus, divides numbers in Excel. However, unlike regular division, the MOD function only gives the remainder as an answer. Uses for this function in Excel include combining it with conditional formatting to produce alternate row and column shading, which makes it easier to read large blocks of data.

The information in this article applies to Excel for Microsoft 365, Excel 2019, Excel 2016, Excel 2013, Excel 2010, and Excel for Mac.

MOD Function Syntax and Arguments

A function's syntax refers to the layout of the function and includes the function's name, brackets, and arguments.

The syntax for the MOD function is:

MOD(Number, Divisor)

Number is the number being divided and Divisor is the number by which you want to divide the Number argument. The Number argument can be a number entered directly into the function or a cell reference to the location of the data in a worksheet.

The MOD function returns the #DIV/0! error value for the following conditions:

  • If a zero is entered for the Divisor argument.
  • If a cell reference to a blank cell is entered for the Divisor argument.

Use Excel's MOD Function

Enter data into the cells. To follow along with this tutorial, enter 5 in cell D1 and enter 2 in cell D2.

  1. Select cell E1. This is where the results will display.

    E1 selected in Excel
  2. Select the Formulas tab.

    Formulas tab in Excel
  3. Choose Math & Trig to open a drop-down list.

    Math & Trig drop-down list
  4. Select MOD to open the Function Arguments dialog box.

    Selecting the MOD function in Excel.
  5. In the dialog box, place the cursor in the Number text box.

    Viewing the Function Arguments dialog in Excel.
  6. Select cell D1 on the worksheet.

    Selecting the first number in the MOD function.
  7. In the dialog box, place the cursor in the Divisor text box.

  8. Select cell D2 on the worksheet.

    Entering the Divisor in the Excel MOD function.
  9. Select OK in the dialog box.

  10. The answer 1 appears in cell E1 (5 divided by 2 leaves a remainder of 1).

    Showing MOD results in Excel.
  11. Select cell E1 to see the complete function, =MOD( D1,D2), in the formula bar above the worksheet.

    Showing the MOD formula in Excel.

Since the MOD function only returns the remainder, the integer portion of the division operation (2) is not displayed. To show the integer as part of the answer, use the QUOTIENT function.

Was this page helpful?