Count cells in a range

  • Thread starter Thread starter Otto Moehrbach
  • Start date Start date
O

Otto Moehrbach

I posted this yesterday but have not seen it.
Excel XP & Win XP
In VBA, Range(Whatever).Count produces the number of cells in the range,
regardless of the contents of the cells. Is there a worksheet formula that
does the same? Not a UDF, but a plain formula? Thanks for your time. Otto
 
Hi Otto,

Try the following. While it appears to be looking for not blank, for me
under testing that I have done it appears to count all cells whether they are
blank or not. However, I suggest that you test it under the circumstances
where you intend to use it.

There is a separate COUNTBLANK function and I suggest it is there because
the COUNTIF function fails trying to count blanks as a criteria.

I'll be interested if you find any circumstances where it does not work.

=COUNTIF(D1:G20,"<>""")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top