pjfanning opened a new pull request, #1324:
URL: https://github.com/apache/poi/pull/1324

   https://bz.apache.org/bugzilla/show_bug.cgi?id=65231 — 
`SUMPRODUCT(COUNTIF(B1:B3, C1:C3))` with B = a,a,b and C = a,b,a, reported 
against Office 365 with expected 5.
   
   ## What Excel does
   
   Inside SUMPRODUCT, COUNTIF is evaluated once per cell of the criteria range 
and returns one count per criterion: COUNTIF(B,"a") + COUNTIF(B,"b") + 
COUNTIF(B,"a") = 2 + 1 + 2 = 5. The reporter's expectation is right. (Comment 9 
on the bug notes that Numbers gives 2 — Numbers applies implicit intersection 
there and does not match Excel.)
   
   ## What POI did
   
   POI reduced the range criteria to the cell on the formula's own row (C1 = 
"a") and returned a single count, 2 — the same defect as bug 65059, and fixed 
with it in #1323 (`Countif.isArrayCriteria` / `evaluateForEachCriterion`).
   
   ## This PR
   
   Adds the reporter's exact XSSF case as `TestXSSFBugs.testBug65231` so bug 
65231 can be closed against a test of its own. No production change.
   
   
`TestConditionalAggregatesWithArrayCriteria.singleConditionFunctionsWithARangeAsCriteria`
 from #1323 already covers the same shape in HSSF; this one is the report's 
data, in XSSF as reported.
   
   ## Tests
   
   - `testBug65231` fails on `a058a67118` (the commit before #1323) with 
`expected: <5.0> but was: <2.0>` and passes on trunk.
   
   `changes.xml` left for you (bug 65231, fixed by the 65059 change).
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to