Home  >  Article  >  Topics  >  Excel mod

Excel mod

(*-*)浩
(*-*)浩Original
2019-06-05 13:31:088313browse

mod in Excel is a remainder function, its format is: mod(nExp1,nExp2), which is the remainder after division of two numerical expressions. Special note: In EXCEL, the MOD function is used to return the remainder of the division of two numbers. The sign of the returned result is the same as the sign of the divisor.

Excel mod

mod expression

Syntax: MOD(number,divisor)

Parameters:

Number is the dividend.

Divisor is the divisor. In Oracle, if divisor is 0, the function returns number directly.

Explanation:

The function MOD can be expressed by borrowing the function INT:

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

Verify mod(3,-2)(2 photos) in pl/sql dev

Example:

MOD(3, 2) is equal to 1

MOD(-3, 2) is equal to -1

MOD(3, -2) is equal to 1

MOD(-3, -2) is equal to -1

MOD(-3, 0) is equal to -3

MOD(3, 0) is equal to 3

MOD(2, 0) is equal to 2

MOD(4, 3) Equal to 1

Note: The above is the calculation method of MOD function in Oracle, which has been tested in Pl/sql Dev.

Verification mod(3,-2)

In Excel, the divisor cannot be 0, otherwise an error will be reported.

MOD(3, -2) is equal to -1 (the same sign as the following number)

MOD(3, 0) reports an error and the output result is #DIV/0!

In Excel, the rule of integer values ​​when the dividend is less than or equal to the divisor:

Example:

mod(1,3)=1mod(2,3)=2mod(3,3)=0mod(4,3)=1...

Example:

 mod(1,5)=1mod(2,5)=2mod(3,5)=3mod(4,5)=4mod(5,5)=0mod(6,5)=1...

For more Excel-related technical articles, please visit the Excel Basic Tutorial column to learn!

The above is the detailed content of Excel mod. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn