Bug 140665 - "Financial Functions Part Three" help page has wrong order of functions
Summary: "Financial Functions Part Three" help page has wrong order of functions
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
7.1.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-25 12:23 UTC by Aron Budea
Modified: 2022-04-23 14:38 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample for XIRR/XNPV (10.34 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-02-25 12:23 UTC, Aron Budea
Details
LibreOffice 7.1 and excel side by side. (75.86 KB, image/png)
2021-02-25 18:16 UTC, m_a_riosv
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2021-02-25 12:23:31 UTC
Created attachment 170056 [details]
Sample for XIRR/XNPV

file:///usr/share/libreoffice/help/en-US/text/scalc/01/04060118.html?DbPAR=CALC

The help page for Financial Functions Part Three says:
=XIRR(B1:B5; A1:A5; 0.1) returns 0.1828.
and
=XNPV(0.06;B1:B5;A1:A5) returns 323.02.

(the sample data is under XIRR)

The actual results in Calc are 0.1948 and 332.57 respectively.
See the attached sample.
Comment 1 Aron Budea 2021-02-25 12:28:32 UTC
(In reply to Aron Budea from comment #0)
> file:///usr/share/libreoffice/help/en-US/text/scalc/01/04060118.
> html?DbPAR=CALC
Oops, meant to link this:
https://help.libreoffice.org/7.1/en-US/text/scalc/01/04060118.html

In addition, the order is messed up, compare the above with version 7.0's help:
https://help.libreoffice.org/7.0/en-US/text/scalc/01/04060118.html

Ie. in 7.1 help the order is random: INTRATE, XNPV, RRI, XIRR, IPMT.
And in 7.0 the order is alphabetical: RATE, RRI, VDB, XIRR, XNPV.
Comment 2 Aron Budea 2021-02-25 13:58:02 UTC
(In reply to Aron Budea from comment #0)
> The actual results in Calc are 0.1948 and 332.57 respectively.
And the results are correct, they're the same in Excel.
Comment 3 m_a_riosv 2021-02-25 18:16:53 UTC
Created attachment 170061 [details]
LibreOffice 7.1 and excel side by side.

I see the same result in LibreOffice 7.1 and excel
Comment 4 Aron Budea 2021-02-25 18:49:40 UTC
Then you can confirm the help entry is wrong, right?
Comment 5 Ming Hua 2021-02-26 03:58:58 UTC
The main issue (wrong results of XIRR() and XNPV()) in this bug seems to have already been fixed by Steve Fanning a few weeks ago:
https://git.libreoffice.org/help/+/1babc5665e751c926cd049e4784b08b0e2f26f7d%5E%21/

And the online help built from master reflects the fix:
https://help.libreoffice.org/7.2/en-US/text/scalc/01/04060118.html

The problem was in the sample data, cell A2 should be Feb. 1st instead of Jan. 2nd.  Mainly a date format mistake, likely caused by the original help author using a non-standard YYYY-DD-MM format.

The order of entries wasn't touched in the above commit and I didn't investigate further.
Comment 6 Aron Budea 2021-03-01 06:48:12 UTC
Good catch, thanks, nice to see it fixed! Retitling this on the wrong order, then (as described in comment 1).
Comment 7 sdc.blanco 2021-03-01 10:56:51 UTC
(In reply to Aron Budea from comment #6)
> Retitling this on the wrong order,
The ordering problem arises because the sort function (in the help page) cannot handle <h1>,<h2>. You will now see the same kind of problem in other pages that use sort (and have some elements using <h2>)(e.g., Glossary). In short, the problem is not with the Financial page itself, but with the <sort> function that is used in that page.

cc: Ilmari
Comment 8 Julien Nabet 2022-04-23 13:29:46 UTC
The order seems correct in https://help.libreoffice.org/7.3/en-US/text/scalc/01/04060118.html.

Can we close this one now?
Comment 9 Buovjaga 2022-04-23 14:38:23 UTC
(In reply to Julien Nabet from comment #8)
> The order seems correct in
> https://help.libreoffice.org/7.3/en-US/text/scalc/01/04060118.html.
> 
> Can we close this one now?

Yes, seems like this fixed it:
commit 26e5265ade24d7eeeaf7d120e0dbcb4cbc598fed
Author: Olivier Hallot <olivier.hallot@libreoffice.org>
Date:   Wed Apr 14 19:31:31 2021 -0300

    Fix sort order of Calc functions