ODF specification 6.12.20 FV Summary: Compute the future value (FV) of an investment. Syntax: FV( Number Rate ; Number Nper ; Number Payment [ ; [ Number Pv = 0 ] [ ; Number PayType = 0 ] ] ) ... PayType: the type of payment, defaults to 0. It is 0 if payments are due at the end of the period; 1 if they are due at the beginning of the period. =FV(0,0525/1; 10*1; -100; -6500; 2) return result 12 182,00 , should return #error. Last parameter is 2, only 0 or 1 is allowed. =FV(0,0525/1; 10*1; -100; -6500; -2) return result 12 115,19
Created attachment 126058 [details] document used for testing Only Part Type 0 or 1 should be accepted.
See http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.html#__RefHeading__1018270_715980110
PayType should be Logical, not Number. Excel and Gnumeric do the same. https://lists.oasis-open.org/archives/office-comment/201607/msg00004.html
Reopening because PayType for this and related functions is evaluated weirdly as if (PayType > 0.0) ... beginning of period else ... end of period which is complete nonsense.
It appears that many financial functions: CUMPIPMT FV IPMT PMT CUMPRINC PV use a horrible interpretation of boolean values (like [<=0] for false). Changing the subject of the bug report to reflect all functions affected.
*** Bug 100542 has been marked as a duplicate of this bug. ***
*** Bug 100559 has been marked as a duplicate of this bug. ***
*** Bug 100669 has been marked as a duplicate of this bug. ***
(In reply to Winfried Donkers from comment #5) > It appears that many financial functions: > CUMPIPMT > FV > IPMT > PMT > CUMPRINC > PV > use a horrible interpretation of boolean values (like [<=0] for false). > NPER is one of the functions affected, too.
Winfried Donkers committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=8340f6dcfb2f391feeddb1bc24931cd6f145669a tdf#100646 Make correct use argument PartType in financial functions. It will be available in 5.3.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.