https://bz.apache.org/bugzilla/show_bug.cgi?id=62993
Bug ID: 62993
Summary: SUMIF returns wrong result (POI 4.0.x)
Product: POI
Version: 4.0.0-FINAL
Hardware: PC
OS: Mac OS X 10.1
Status: NEW
Severity: normal
Priority: P2
Component: XSSF
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Created attachment 36312
--> https://bz.apache.org/bugzilla/attachment.cgi?id=36312&action=edit
minimal program that demonstrates the problem
I have upgraded some projects to POI 4 and found out that there's a bug in
SUMIF. I create an in-memory XSSF Workbook that contains some data and some
formulas working on that data. SUMIF() only returns the correct result for the
first cell, and returns zero for the remaining cells.
The original program was written by a colleague in Ruby, and it worked in POI
3.x (until the latest pre 4.0-version). Since the first time working with Ruby
was trying to debug said program, I created a minimal Java application to
reproduce the problem
Please take a look at the Excel sheet as it is written by the program. It
should look like this (please ignore the locale specific decimal formatting):
Key Value
1,75 123
2,25 456
3,25 789
1,75 10
3,25 20
3,25 30
0,9 40
1,25 50
Key Sum POI Exp Status
0,9 40 40 40 OK
2,25 456 0 456 FAIL
1,25 50 0 50 FAIL
3,25 839 0 839 FAIL
1,75 133 0 133 FAIL
`Key` is a numeric value
`Sum` is a formula, i.e. "SUMIF(A2:A9;A12;B2:B9)" for the first row,
"SUMIF(A2:A9;A13;B2:B9)" for the second and so on
`POI` is the result calculated by invoking `evaluator.evaluateFormulaCell()`
`Exp` is the expected result (calculated in Java)
`Status` is "OK" if the POI result is the same as in Java
I can reproduce the problem with POI 4.0 and 4.0.1
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]