Bug 123785 - count functions count also empty fields
Summary: count functions count also empty fields
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected) release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
Depends on:
Reported: 2019-03-01 11:47 UTC by burkhard.kasten
Modified: 2019-03-01 20:09 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:


Note You need to log in before you can comment on or make changes to this bug.
Description burkhard.kasten 2019-03-01 11:47:49 UTC
Commands like


count also empty fields.

Fields which contain 0 are not counted (correct)
Fields which contain nothing are counted (wrong)

Steps to Reproduce:
Create a new Calc file
Select field A1
Enter command like

Result is 75 even if all fields are empty

Actual Results:

Reproducible: Always

User Profile Reset: No

Additional Info:
[Information automatically included from LibreOffice]
Locale: de
Module: SpreadsheetDocument
[Information guessed from browser]
OS: Windows (All)
OS is 64bit: no
Comment 1 Mike Kaganski 2019-03-01 12:09:31 UTC
I'm not quite sure it's a bug.

OpenDocument v.1.2 documentation on COUNTIF (part 2, 6.13.9) [1] refers to 4.11.8 Criterion; and that section tells this:

> Note: "=0" does not match empty cells.

... which might imply that "<>0" does match empty cells as negation of "=0"...
Maybe Eike has a better explanation.

[1] http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.html#__RefHeading__1018360_715980110
Comment 2 MM 2019-03-01 16:21:24 UTC
On windows 7 x64 with Version: (x64)
Build ID: dc89aa7a9eabfd848af146d5086077aeed2ae4a5
CPU threads: 3; OS: Windows 6.1; UI render: default

the outcome is 0.

On windows 10 with Version: (x64)
Build ID: 7bcb35dc3024a62dea0caee87020152d1ee96e71
CPU threads: 2; OS: Windows 10.0; UI render: default; VCL: win

the outcome = 75.

So what is the correct outcome ?
Comment 3 Oliver Brinzing 2019-03-01 17:40:43 UTC
the implementation changed with LO 6.1.3 fixing issue:

COUNTIF with criterium <>number does not count empty cells.
Comment 4 Mike Kaganski 2019-03-01 20:09:42 UTC
So, the reported behavior is correct and consistent with standard -> NOTABUG.

Thanks for your report! A report that turns out not a bug is way better than not reporting what could be a real problem.