Bug 65231 - wrong evaluation of SUMPRODUCT when nested COUNTIF uses ranges
Summary: wrong evaluation of SUMPRODUCT when nested COUNTIF uses ranges
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: SS Common (show other bugs)
Version: 4.1.2-FINAL
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on: 65059
Blocks:
  Show dependency tree
 
Reported: 2021-04-09 14:31 UTC by gerard.duong
Modified: 2021-04-27 05:51 UTC (History)
0 users



Attachments
test case for reproduction (1.81 KB, text/plain)
2021-04-09 14:31 UTC, gerard.duong
Details
expected output if workbook written on file system (10.93 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2021-04-09 14:34 UTC, gerard.duong
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gerard.duong 2021-04-09 14:31:19 UTC
Created attachment 37804 [details]
test case for reproduction

I'm managing an XSSF workbook within which I have a formula cell with a COUNTIF inside a SUMPRODUCT. But its evaluation gives a bad result: it is different from Excel of Office 365.

The nested COUNTIF uses ranges as criteria. For example:
SUMPRODUCT(COUNTIF(B1:B3, C1:C3))

The evaluation is done via FormulaEvaluator.evaluate(Cell).



I'm providing a test case for more details.

This bug is similar to 65059, but I'm not sure if it is really a duplicate: My work-in-progress fixes of the 65059 do not apply to this bug.
Comment 1 gerard.duong 2021-04-09 14:33:14 UTC
The Countif class did not change in the last release, so I believe this bug also applies to the 5.0.0-FINAL version.
Comment 2 gerard.duong 2021-04-09 14:34:44 UTC
Created attachment 37805 [details]
expected output if workbook written on file system