To count the number of cells that have any text (even a single space) we can use COUNTIF function of excel.
Generic Formula for Counting Cells containing texts
The wild card character “*” counts any cell that contains text. Let’s see some examples of count cells with text.
I have data in range A2:A8 (A4 contains space).
Now to count the number of cells that have text I will write this COUNTIF formula in cell C2.
And as a result I will get 4.
The will card character “*” only applies to the text, hence the COUNTIF function counts as any cell that contains the text. The numbers and errors arexclueded. (dates are also numbers, hence they will be excluded from the count.)
Now sometimes you want to exempt some text to be counted. For our example, we don’t want to count cells who contain spaces only. Here we can use COUNTIFS to count cells containing text with exemption text.
Generic Formula for Counting Cells Containing Text With Exemption Text
We have the same data. Now we want to count cell containing text only except cells containing spaces only.
I am writing this formula in C3:
We have our count of cells containing any text other than cell containing spaces.
How does it work?
The first part A2:A8,"*", looks for any text containing cell.
The second part AA2:A8,"<>* *", excludes any cell containing only spaces.(<> this is NOT operator.)
So yeah, this is the way you can count cells containing text in excel 2016 or older. Let me know if the solution for your problem else explains your problem in the comments section below.
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.