totn Excel Functions

MS Excel: How to use the MOD Function (WS)

This Excel tutorial explains how to use the Excel MOD function with syntax and examples.

Description

The Microsoft Excel MOD function returns the remainder after a number is divided by a divisor.

The MOD function is a built-in function in Excel that is categorized as a Math/Trig Function. It can be used as a worksheet function (WS) in Excel. As a worksheet function, the MOD function can be entered as part of a formula in a cell of a worksheet.

Please read our MOD function (VBA) page if you are looking for the VBA version of the MOD function as it has a very different syntax.

Syntax

The syntax for the MOD function in Microsoft Excel is:

MOD( number, divisor )

Parameters or Arguments

number
A numeric value whose remainder you wish to find.
divisor
The number used to divide into the number parameter. If the divisor is 0, then it will return the #DIV/0! error.

Returns

The MOD function returns a numeric value.
If the divisor is 0, then the MOD function will return the #DIV/0! error.

Applies To

  • Excel for Office 365, Excel 2019, Excel 2016, Excel 2013, Excel 2011 for Mac, Excel 2010, Excel 2007, Excel 2003, Excel XP, Excel 2000

Type of Function

  • Worksheet function (WS)

Example (as Worksheet Function)

Let's look at some Excel MOD function examples and explore how to use the MOD function as a worksheet function in Microsoft Excel:

Microsoft Excel

Based on the Excel spreadsheet above, the following MOD examples would return:

=MOD(A1, A2)
Result: 2

=MOD(A1, A3)
Result: -7

=MOD(34, A2)
Result: 0

=MOD(34, 0)
Result: #DIV/0!