Tuesday, October 25, 2016

Count (Dracula?)


No, we are not talking about the infamous Count Dracula this week, but since Halloween is next Monday, we most certainly are going to discuss the varied and highly utile Count functions (and have a little fun with Dracula along the way…)!

There are several major types of Count Functions. In summary, they are:

1. COUNT: Simply counts the number of cells in a range that contain a number
2. COUNTA: Counts the number of non-blank cells in a range (including those with text)
3. COUNTBLANK: Counts the number of empty cells
4. COUNTIF: Flexible counting function (this can be a little tricky, so we will explore with some examples)

The COUNTIF function is a Wickedly Useful, and sometimes Tricky (Hey, next week is Halloween), method to derive valuable information from your data, so we are going to look at some examples (I think you will find them a real Treat!)

The reason this function can be challenging to some users is because of the prevalent use of Quotation Marks within the formulas. The following examples will demonstrate how it works (Note: In each case, the formula uses a range named Data):

Count the number of cells that contain the first name of Dracula - "Vlad" (BTW, not case sensitive):
=COUNTIF(Data,"Vlad")

Count the number of cells that contain the words "Vlad" and “Igor”:
=COUNTIF(Data,"Vlad") + COUNTIF(Data,"Igor")

Count the number of cells containing Any Text (ignoring the numbers):
=COUNTIF(Data,"*")

Count the number of 3-letter words:
=COUNTIF(Data,"???")

Count the number of cells containing text that begins with the letter "V":
=COUNTIF(Data, “V*”)

Count the number of cells that contain a value Greater Than Or Equal to 13:
=COUNTIF(Data,">=13")

Count the number of cells that contain a value from 13 to 33:
=COUNTIF(Data,">=13")-COUNTIF(data,">33")

With a bit of ingenuity, COUNTIF can indeed be a Treat to use. So, this Halloween, don’t forget the Count!  (I am sure Vlad will be pleased…)

No comments: