Download it now!
Bug 77039 - COUNTIF function doesn't match empty formula cell results
Summary: COUNTIF function doesn't match empty formula cell results
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.2.1 release
Hardware: Other All
: high major
Assignee: Kohei Yoshida
URL:
Whiteboard: target:4.3.0 target:4.2.4
Keywords: regression
Depends on:
Blocks:
 
Reported: 2014-04-04 05:39 UTC by HD
Modified: 2014-05-07 01:05 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
COUNTIF doesn't count blank cells from formulas (11.09 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-04-04 05:39 UTC, HD
Details

Note You need to log in before you can comment on or make changes to this bug.
Description HD 2014-04-04 05:39:11 UTC
Created attachment 96884 [details]
COUNTIF doesn't count blank cells from formulas

Instead of COUNTBLANK, I used COUNTIF function to count blank cells from formulas on LibreOffice 4.1, because COUNTBLANK cannot count them. 

However after updating from 4.1.4 to 4.2.2, the formula always returns "0".

See the attached document and check cell B9 ...=COUNTIF($B$3:$B$8,"")
COUNTIF returns "0" on LO 4.2, though the correct answer is "4".

As a workaround on LO 4.2, I use SUMPRODUCT function temporarily,
=SUMPRODUCT(($B$3:$B$8="")*1)

The same problem occers with SUMIF function.
(Check cell F9 in attached document)
Comment 1 m.a.riosv 2014-04-04 23:42:26 UTC
Hi HD, thanks for reporting.

Works for me with:
Win7x64Ultimate
Version: 4.1.6.0.0+ Build ID: 0b772a163b2536fc55aa3b4de925119e33af769
Version: 4.3.0.0.alpha0+ Build ID: 2aaf9a5c9a06b770598c84b427c5099bf127d856
   TinderBox: Win-x86@39, Branch:master, Time: 2014-03-31_23:59:45

But reproducible with:
Version: 4.2.0.4 Build ID: 05dceb5d363845f2cf968344d7adab8dcfb2ba71
Version: 4.2.2.1 Build ID: 3be8cda0bddd8e430d8cda1ebfd581265cca5a0f
Versión: 4.2.3.2 Id. de compilación: 7c5c769e412afd32da4d946d2cb0c8b0674e95e0
Version: 4.2.4.0.0+ Build ID: 172c33146d7e8b4f741d52ab7c9dfdb55c847401
   TinderBox: Win-x86@42, Branch:libreoffice-4-2, Time: 2014-04-01_09:38:08
Comment 2 Kohei Yoshida 2014-04-24 23:43:38 UTC
Taking it.
Comment 3 Commit Notification 2014-04-24 23:44:50 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=380631d0e24d8bf90a5431b3e3c5fb36f21dbcf0

fdo#77039: Write test for this.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2014-04-24 23:45:03 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=50708577850544920c746ebc382d47275452a761

fdo#77039: Fill the match string even if the raw string is empty.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 5 Kohei Yoshida 2014-04-24 23:46:27 UTC
4.2 backport: https://gerrit.libreoffice.org/9155
Comment 6 Commit Notification 2014-04-25 15:45:19 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9f115c83fe94b0ed86562906f9d96465e59ec761&h=libreoffice-4-2

fdo#77039: Fill the match string even if the raw string is empty.


It will be available in LibreOffice 4.2.5.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 7 Kohei Yoshida 2014-04-25 15:47:58 UTC
Fixed.  Keep on rolling.
Comment 8 Eike Rathke 2014-04-25 15:48:44 UTC
Pending review for 4-2-4 at https://gerrit.libreoffice.org/9164
Comment 9 Commit Notification 2014-04-29 16:24:00 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-4-2-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c80717bba0c0a55092ff0b1564191dda22b3bad5&h=libreoffice-4-2-4

fdo#77039: Fill the match string even if the raw string is empty.


It will be available already in LibreOffice 4.2.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 10 m.a.riosv 2014-05-07 01:05:51 UTC
Verified with:
Wint7x64Ultimate
Version: 4.2.4.2 Build ID: 63150712c6d317d27ce2db16eb94c2f3d7b699f8
Version: 4.2.5.0.0+ Build ID: b26b9606efa30c0a44e20dcf638fbd1e27f05089
   TinderBox: Win-x86@42, Branch:libreoffice-4-2, Time: 2014-05-06_06:43:43
Version: 4.3.0.0.alpha1+ Build ID: a1dd961c3093f5f7624e4d1f2240e9120fd13f23
   TinderBox: Win-x86@39, Branch:master, Time: 2014-05-06_11:47:48