Search Not Just Numbers

Tuesday, 13 August 2013

Excel Tip: COUNT, COUNTA and COUNTBLANK

Before we get into this week's post I'd just like to comment on how popular Mynda Treacy's Excel Dashboards course proved with readers. Unfortunately, registration for the course is now finished. Given its success, I will certainly be making it available to readers next time Mynda runs the course - just make sure that you are subscribed to the blog so that I can keep you posted.

In the meantime, you might want to take a look at Mynda's Excel Expert course which is of the same high standard.

OK, on with today's post...

I have covered COUNTIF in a previous post, but today I want to look at three much simpler functions that do a similar task in specific circumstances.

All of the functions have one argument, the range they are to apply to, i.e.

=FUNCTION(range)

NB: there can be multiple arguments, e.g.

=FUNCTION(range1,range2,range3)

or even a list of numbers, although this has less practical use.

So, let's look at each one in turn:

COUNT
This function returns the number of cells that contain numbers within the range or ranges. This does include zeroes. and the results of formulae.

COUNTA
This function returns the number of cells that are not empty within the range or ranges. This does mean anything, including a formula that returns null.

COUNTBLANK
This is essentially the reverse of COUNTA, i.e. it returns the number of empty cells. Again, a formula will not be a blank, irrespective of its result.

Example:

If we apply each of the functions to the range A1:B5 above, we get the following:

=COUNT(A1:B5), returns 4, as the range contains 4 numbers

=COUNTA(A1:B5), returns 8, as there are 8 non-empty cells

=COUNTBLANK(A1:B5), returns 2, as there are 2 blank cells

Not as flexible as COUNTIF but, I'm sure you will agree, much simpler for these specific scenarios.

If you enjoyed this post, go to the top of the blog, where you can subscribe for regular updates and get your free report "The 5 Excel features that you NEED to know".

1 comment:

Hi, I'm Glen Feechan. Welcome to my Excel blog - Not Just Numbers.

I aim to provide practical Excel tips to those using Excel in their day-to-day jobs. I am a Chartered Accountant who has used Excel for too many years to remember, and now focus my efforts on helping others to get the most out of this powerful tool.

If you have any Excel requirements, I provide both on-site and remote consultancy and development services, of which you can find out more here.

You can sign up (below) and get a free report and regular updates of new posts to the blog.
Also have a look at the freebies section for free training videos, etc.

I hope you find the content useful and that every now and again it makes you smile.