count for empty cells

  • Thread starter tikchye_oldLearner57
  • Start date
T

tikchye_oldLearner57

hello community

can anyone in community tell me whether is there a function to count for
"empty" cells beside the Count (counting cells that has numeric data) and
CountA (counting of cells that had filled alphanumeric data)

thanks again for helping
 
M

Miguel Zapico

Hi,

There is a function called COUNTBLANK in my function lists, that does that;
I am using Excel 2003, so I don't know if it was present in previous versions.

Miguel.
 
S

Stefi

E.g. in range B1:B10
=COUNTIF(B1:B10,"")

Regards,
Stefi

„tikchye_oldLearner57†ezt írta:
 
K

Kevin B

You can use the following UDF to count your blank cells.

If you wanted to count the blank cells between A1 and A10 you would enter
the formula where you want the result in the following manner:

=CountBlanks(A1:A10)

Function CountBlanks(CellRange As Range) As Integer

Dim rng As Range
Dim iCounter As Integer
Dim iBlanks As Integer
Set rng = CellRange

Application.Volatile

For iCounter = 1 To rng.Cells.Count
If rng.Cells(iCounter).Value = "" Then iBlanks = _
iBlanks + 1
Next iCounter

Set rng = Nothing
CountBlanks = iBlanks
Exit Function

End Function
 
G

Gary''s Student

Be aware:

A cell can be blank, but not empty. In cell A1 enter:

=IF(1=1,"","")

countblank(A1) will return 1 even though the cell is not empty.

In VBA IsEmpty() will return true on truely empty.
 
T

tikchye_oldLearner57

thanks to Miguel Zapico , Stefi , Kevin B , Gary''s Student for the generous
assistance given :)

yes! so near yet so far - the function "countblank" is found inside the
function table
 
S

SteveC

So in your opinion what's the best way to count a cell with no value, but a
cell that may have a formula? thanks!
 
Top