result = number1 MOD number1

Returns the remainder after division operator (Integer).


number1The number you want the remainder of (Double).
number2The number you want to divide by (Double).

REMARKS
* This is actually an operator as opposed to a function.
* The equivalent Excel function is Application.WorksheetFunction.MOD
* The VBA operator and the worksheet function return different values when the number and divisor have opposite signs.
* For the Microsoft documentation refer to docs.microsoft.com

3 Mod 2 = 1 
-3 Mod 2 = -1
3 Mod -2 = 1
5 Mod 10 = 5
15 Mod 2 = 7
4 Mod 2 = 0
12.6 Mod 5 = 3
12.1 Mod 5 = 2
True Mod True = 0
False Mod False = #DIV/0!
20 Mod 0 = #DIV/0!

© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited Top