Bug 50437

Summary: NPV Function doesn't properly support ranges
Product: POI Reporter: Jon Svede <jsvede>
Component: POI OverallAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal CC: marcel.may.de
Priority: P2    
Version: 3.7-FINAL   
Target Milestone: ---   
Hardware: All   
OS: All   
Bug Depends on: 50409    
Bug Blocks:    
Attachments: Test .xls file that demonstrates the issue.
Patch fixing NPV computation and adding range support

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