How to Count Text Values in Microsoft Excel
One of the exercises we run through in our courses is the COUNT function. This is very handy when you want to find out how many cells have a number in but you are not interested in adding the values together.

Initially, people can get confused with the difference between SUM and COUNT. Sum totals the values in a range of cells, whereas COUNT simply counts the cells with a numeric value in, regardless of the figure.


 Using the Count function

The COUNT function is limited to numbers (which include dates and formulas) and does not count cells with text in them. The picture below shows a count of 5 cells with a number in, even though none of the cells in the range are empty.

Count text values function in Excel

This is a useful function but there may be times when it could be advantageous to count cells which have something in them, regardless of whether it's text or numbers.

This very straightforward formula is almost identical to COUNT. In fact its purpose is to count any alphanumeric character, so the structure of the formula is =COUNTA(), with the cell range you wish to count between the brackets.

COUNTA will count all alphanumeric data types including dates and formulas, so this formula essentially counts all the non-blank cells.

Counta function in Excel

What is the COUNTIF function and when is it needed?

You may not want to count all the numbers in a range, only certain ones, so to apply criteria to your COUNT formula, there is the COUNTIF function. The below formula would only count the cells with numbers in A1 to A10 if the value of the cell is less than (<) 10.

=COUNTIF(A1:A10,"<10")

You can use COUNTIF on any alphanumeric data to apply criteria to it, it doesn't have to be used on numbers. For example, the following formula would count how many times the word "Cancelled" appeared in range A1 to A10.

=COUNTIF(A1:A10,"Cancelled")