| Summary: | COUNTIFS function not evaluating correctly when not only checking for equality | ||
|---|---|---|---|
| Product: | LibreOffice | Reporter: | karoshi |
| Component: | Calc | Assignee: | Not Assigned <libreoffice-bugs> |
| Status: | CLOSED NOTABUG | ||
| Severity: | normal | ||
| Priority: | medium | ||
| Version: | 6.4.0.3 release | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Crash report or crash signature: | Regression By: | ||
| Attachments: | Countifs works in LO 5.x, broken since 6.0 | ||
The result 2 in A9 is correct. The formula is =COUNTIFS($A$2:$A$5; "foo"; $B$2:$B$5;"<>''") The Criteria "<>''" matches all cells where the content is not the literal string '' (two consecutive appostrophes). The "''" does *not* denote an empty string. If you wanted to match non-empty cells then the Criteria argument should be "<>", i.e. only the <> operator without further value. I don't recall what 5.9 may have done there, but if the result was 1 in that case then it was wrong. There was some bug with the IFS() function. Even better. Thanks a lot! |
Created attachment 157945 [details] Countifs works in LO 5.x, broken since 6.0 Countifs is defined to count 1 when all criteria are met which seems not to work properly when not only comparing with some fixed content. The attached file shows a countifs of 1 in both cases when opened in LibreOffice Calc 5.9 (correct). But 2 for the first value (incorrect), 1 for the latter (correct) when opened in 6.0 through 6.4. The issue has appeared in a disclosed document so I created a minimal test as attached.