Bug 138388 - Calc functions ODDFPRICE and ODDFYIELD do not appear to work correctly
Summary: Calc functions ODDFPRICE and ODDFYIELD do not appear to work correctly
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-Function
  Show dependency treegraph
 
Reported: 2020-11-21 08:49 UTC by Steve Fanning
Modified: 2021-02-10 09:39 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Fanning 2020-11-21 08:49:33 UTC
Description:
Unable to find any combination of arguments that give a meaningful result for either function. Constantly return #VALUE!

Code inspection of GetOddfprice and GetOddfyield functions in file source/analysis/analysishelper.cxx seems to indicate that both unconditionally throw a runtime exception.

AOO Bugzilla #92177 also refers.

Steps to Reproduce:
See Description

Actual Results:
See Description

Expected Results:
See Description


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.0.2.2 (x64)
Build ID: 8349ace3c3162073abd90d81fd06dcfb6b36b994
CPU threads: 6; OS: Windows 10.0 Build 19041; UI render: Skia/Vulkan; VCL: win
Locale: en-GB (en_GB); UI: en-US
Calc: threaded
Comment 1 Julien Nabet 2020-11-21 09:29:01 UTC
Seems like that since:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=2f0d97cd957cdb3113d98cbc441a923a43367547
author	Daniel Rentz <dr@openoffice.org>	2001-09-26 12:22:24 +0000
committer	Daniel Rentz <dr@openoffice.org>	2001-09-26 12:22:24 +0000
commit	2f0d97cd957cdb3113d98cbc441a923a43367547 (patch)
tree	d13dfd89a8e98f081692a92c7fb56bb33dfc0ae2
parent	f5b732c43a9ed9ace11412d85dacd96d849fcde1 (diff)
#87380# return error for ODDF(PRICE|YIELD) due to faulty algorithms

Eike: should we remove these functions or should we still wait for someone try to implement them?
(I found these links from MS:
https://support.microsoft.com/en-us/office/oddfprice-function-d7d664a8-34df-4233-8d2b-922bcf6a69e1
http://www.mit.edu/~mbarker/formula1/f1help/05-n-s18.htm
)
Comment 2 Eike Rathke 2020-11-23 18:37:13 UTC
Removing the functions wouldn't help anything except changing the error from #VALUE! to #NAME? ...

Keeping them has the benefit that when a document is saved as old .xls binary format then the macro class is preserved due to the implementation as Add-In and it would (continue to) work in Excel.
Comment 3 Julien Nabet 2020-11-23 18:44:05 UTC
(In reply to Eike Rathke from comment #2)
> Removing the functions wouldn't help anything except changing the error from
> #VALUE! to #NAME? ...
Just decruftify a bit the code
> 
> Keeping them has the benefit that when a document is saved as old .xls
> binary format then the macro class is preserved due to the implementation as
> Add-In and it would (continue to) work in Excel.
Didn't know about this part.
Ok I understand better now why this thing is still there unimplemented after so many years.
Thank you for the feedback! :-)
Comment 4 Olivier Hallot 2021-02-10 09:39:30 UTC
Both functions are in ODFF standard.

https://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.html#__RefHeading__1018292_715980110