Returns the remainder when one integer is divided by another.
For integer arguments this function returns Dividend modulo Divisor, that is the remainder when Dividend is divided by Divisor.
This function is implemented as Dividend - Divisor * INT(Dividend/Divisor) , and this formula gives the result if the arguments are not integer.
=MOD(22;3) returns 1, the remainder when 22 is divided by 3.
=MOD(11.25;2.5) returns 1.25.
The results are not correct for a MOD function. If the formula provided is truly the one being used then it is wrong.
A corrected formula would be (Dividend/Divisor)-INT(Dividend/Divisor)
That will give the remainder which is being searched for when using this math function.
Build ID: 55b006a02d247b5f7215fc6ea0fde844b30035b3
Locale: en-US (en_US)
This example is wrong.
The spreadsheet requires it to be MOD(Dividend,Divisor)
If a semi colon is used it is automatically replaced with a comma.
This just seems like a documentation error so I'm punting to them.
Which separator is used between function arguments is a user setting in Tools > Options > LibreOffice Calc > Formula. The help texts always assume a semicolon as separator. Currently it is not possible to depend the help texts on the user setting, and there exists no plans to implement such feature.
I suppose this can be marked as duplicate of a generic bug about argument separators in UI vs. in Help.
*** This bug has been marked as a duplicate of bug 88945 ***
If I read the issue right that was only one of the issues reported:
"This function is implemented as Dividend - Divisor * INT(Dividend/Divisor) , and this formula gives the result if the arguments are not integer."
"A corrected formula would be (Dividend/Divisor)-INT(Dividend/Divisor)"
The MOD function is implemented same as in other spreadsheet applications like Excel, Gnumeric or Google tables and as the % operator in programming languages.
The suggestion of the reporter would give the fractional part of the quotient, but not the remainder. Perhaps the reporter confuses it with the function modf in C/C++.