Counting Cells With Text

D

DonArturo

I would like to be able to count the number of cells within a range that
contain text, excluding those that are strictly numeric values. For example,
counting:
34
52
n/a
987
ooops
4
would return the result of 2.
 
G

Glenn

DonArturo said:
I would like to be able to count the number of cells within a range that
contain text, excluding those that are strictly numeric values. For example,
counting:
34
52
n/a
987
ooops
4
would return the result of 2.

Array formula (commit with CTRL+SHIFT+ENTER):

=SUM(--ISTEXT(A1:A6))

Keep in mind that this will also count cells that look like numbers but are
actually entered as text. As an example, enter '52 instead of 52 in the data above.
 
H

Harlan Grove

Mike H said:
Try this

=COUNTA(A1:A6)-COUNT(A1:A6)
....

This counts all entries except numbers, which means it'd count boolean
and error values in addition to text.

Simplest way to count cells containing text is

=COUNTIF(range,"*")

which would include nonblank cells evaluating to "". To count only
text with one or more characters, use

=COUNTIF(range,"?*")
 
D

DonArturo

Thanks guys. All three solutions worked as you said.
Harlan: Using =COUNTIF(range,"*") was especially helpful because it counted
both the text cells and the "" or null cells, which is what I needed. That
is, it counted them in the simple COUNTIF version. Using COUNTIFS, however,
produced a different result because I must put the equals inside the quotes.
Here is the actual formula:
=COUNTIFS($D$2:$D$1600,AE1,$K$2:$K$1600,">0",$N$2:$N$1600,"=*")
In this instance, it only counts the text cells and not the "" or null
cells. My workaround is to also use
=COUNTIFS($D$2:$D$1600,AE1,$K$2:$K$1600,">0",$N$2:$N$1600,"")
and add them together.
Unless you know a better way... :)
Thanks again.
Peace


_________________________________________
 

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

Top