Bug 100762 - NPV function, second parameter array
Summary: NPV function, second parameter array
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Winfried Donkers
URL:
Whiteboard: target:5.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-04 14:47 UTC by raal
Modified: 2016-10-25 18:39 UTC (History)
3 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 raal 2016-07-04 14:47:37 UTC
=NPV(0,0875;{10;20;30}) throws error in Calc, return result in Excel. 

ODF spec:
 
      6.12.30NPV
  
  *Summary:* Compute the net present value (NPV) for a series of periodic cash
  flows.
  
  *Syntax:* NPV( /Number/ Rate ; { /NumberSequenceList/ Value } + )
Comment 1 Dennis Roczek 2016-07-04 15:13:04 UTC
https://help.libreoffice.org/5.1/Calc/Financial_Functions_Part_Two#NPV

-->

=NPV(0,0875;10;20;30)

works


Same for Excel: 
=NPV(0,0875;{10;20;30})
does not work here (Excel 2013)
Comment 2 Dennis Roczek 2016-07-04 15:14:24 UTC
@raal: the spec is nothing saying about brackets. This is the annotation that there can be inserted multiple values in that formula. see the helpwiki link
Comment 3 Dennis Roczek 2016-07-04 15:25:41 UTC
sry for the noise.

CONFIRMED: Arrays are really not yet integrated in Calc.
Comment 4 Eike Rathke 2016-07-04 18:03:30 UTC
Be careful with the separators, =NPV(0.0875,{10,20,30}) or =NPV(0.0875,{10;20;30}) work in Excel.
Comment 5 Winfried Donkers 2016-07-08 05:42:36 UTC
Will add support for array arguments.
Comment 6 Commit Notification 2016-07-12 12:39:29 UTC
Winfried Donkers committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e4b3772ef966fb3db8dfaa55dfc5f5582d61761d

tdf#100762 Add support for array arguments to NPV.

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.