Bug 50437 - NPV Function doesn't properly support ranges
Summary: NPV Function doesn't properly support ranges
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 3.7-FINAL
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on: 50409
Blocks:
  Show dependency tree
 
Reported: 2010-12-08 23:26 UTC by Jon Svede
Modified: 2010-12-10 10:00 UTC (History)
1 user (show)



Attachments
Test .xls file that demonstrates the issue. (13.50 KB, application/vnd.ms-excel)
2010-12-08 23:26 UTC, Jon Svede
Details
Patch fixing NPV computation and adding range support (7.84 KB, patch)
2010-12-09 00:28 UTC, Marcel May
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Svede 2010-12-08 23:26:51 UTC
Created attachment 26379 [details]
Test .xls file that demonstrates the issue.

Using POI 3.7 the NPV function doesn't support ranges in the second argument.   For example, assume that A1 thru A3 contain numbers and A4 contains some double value.  Assume A4 is the cell in which we are using the NPV function. The formula:

=NPV(A4,A1,A2,A3) - works
=NPV(A4,A1:A3) - fails

When you use POI to evaluate these, the first expression works but the second one does not and it should.
Comment 1 Marcel May 2010-12-09 00:28:54 UTC
Created attachment 26382 [details]
Patch fixing NPV computation and adding range support

- Fixes the NPV computation by using FinanceLib.npv
- Supports ranges now
- Includes a POI TestNpv test case based on Excel NPV help description example
Comment 2 Yegor Kozlov 2010-12-10 10:00:57 UTC
Applied in r1044370

Yegor