Bug 40096

Summary: COUNTBLANK doesn't count formulas
Product: LibreOffice Reporter: James <freedesktop>
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED NOTABUG    
Severity: major CC: jeffdchang, yfjiang
Priority: medium    
Version: 3.4.2 release   
Hardware: Other   
OS: macOS (All)   
URL: http://office.microsoft.com/en-us/excel-help/countblank-HP005209028.aspx
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: Spreadsheet showing COUNTBLANK bug

Description James 2011-08-15 01:33:33 UTC
Created attachment 50217 [details]
Spreadsheet showing COUNTBLANK bug

According to the above URL from Microsoft, COUNTBLANK (unlike its sister function ISBLANK) counts as blank cells containing functions or formulas that return the null string ("").

To see this bug in action, open the attached spreadsheet. In cells A1:A2 (R1C1:R2C1), you can see COUNTBLANK returning 0 when it should return 1.
Comment 1 Jeffrey 2011-08-16 07:23:11 UTC
Confirmed for LibreOffice 3.4  340m1(Build:103) for OpenSuse Linux.
Comment 2 Markus Mohrhard 2011-08-16 19:16:11 UTC
For LibreOffice/OpenOffice the following url is more important:
http://wiki.services.openoffice.org/wiki/Documentation/How_Tos/Calc:_COUNTBLANK_function

"A cell that contains blank text such as spaces, or even text with zero length such as returned by ="", is not considered empty, even though it may appear empty."
Comment 3 James 2011-08-17 03:13:38 UTC
Spurious incompatibility with Excel that breaks spreadsheets is surely a bad thing.
Comment 4 Markus Mohrhard 2011-08-18 01:29:15 UTC
Two points:

-We are not excel

-I Don't think we should change this behaviour because this is documented and old documetns may rely on this.
Comment 5 Markus Mohrhard 2011-08-18 01:36:59 UTC
Additionally the odf 1.2 standard mentions:

Counts the number of blank cells in the Reference provided. A cell is blank if the cell is empty for purposes of COUNTBLANK. If ISBLANK(R) is true, then it is blank. A cell with numeric value zero ('0') is not blank. It is implementation-defined whether or not a cell returning the empty string ("") is considered blank; because of this, there is a (potential) subtle difference between COUNTBLANK and ISBLANK.

I think that with this information it is clear that it is not a bug.