What is the function mod

REST function

This article discusses the formula syntax and usage of the REST described in Microsoft Excel.

description

Returns the remainder of a division. The result has the same sign as the divisor.

syntax

REST (number; divisor)

The REST function syntax has the following arguments:

• number Required. The number for which to find the remainder of a division.

• divisor Required. The number to divide "Number" by.

Hints

• If divisor has the value 0, REST returns the error value # DIV / 0! back.

• The REST function can also be formulated using the INTEGER function:

MOD (n, d) = n - d * INT (n / d)

example

Copy and paste the sample data in the following table into cell A1 of a new Excel worksheet. To see the results of the formulas, highlight them, press F2, and then press ENTER. If necessary, you can adjust the width of the columns so that all data is displayed.

formula

description

Result

= REMAIN (3; 2)

Remainder of 3/2

1

= REMAIN (-3,2)

Remainder of -3/2. The sign is identical to that of the divisor.

1

= REMAIN (3; -2)

Remainder of 3 / -2. The sign is identical to that of the divisor.

-1

= REMAIN (-3, -2)

Remainder of -3 / -2. The sign is identical to that of the divisor.

-1