Page 1 of 1

[Solved] COUNTIF for non blank and blank cells

Posted: Fri Sep 15, 2017 5:00 am
by luofeiyu
To count non blank with =countif(a2:a12;"<>""")
non-blank.png
Why can't count blank with =countif(a2:a12;"=""")
blank.png

Re: countif for non blank and blank cells

Posted: Fri Sep 15, 2017 5:31 am
by FJCC
I showed how to count blank cells here using the SUMPRODUCT() function. OpenOffice distinguishes between a cell that contains nothing and a cell that contains a formula that returns an empty string. In your example, put this formula in A5

Code: Select all

=IF(A1 = 8; 1; "")
The formula

Code: Select all

=COUNTIF(A2:A12;"")
will count that cell. It will not count the blank cells.

Re: countif for non blank and blank cells

Posted: Fri Sep 15, 2017 10:23 am
by Villeroy
There is a function to count blanks:
=COUNTBLANK(A1:F99)

All cells minus non-blanks:
=ROWS(A1:F99)*COLUMNS(A1:F99)-COUNTA(A1:F99)
COUNTA counts all non-empty cells, COUNT counts numbers only.