Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel: How to count the number of cells with a string 2

Status
Not open for further replies.

CGSB

Programmer
May 23, 2006
35
CA
I would like to use a formula that will count the number of cells (within a range) that have text. For example, cell B2 = "Pineapple", cell B3 = "Word", cell B4 = null. I would like the resulting count to be 2.

This is what I tried:

=COUNT(IF(LEN(B2:B19) > 0, 1, 0))

But the result is 0.

Please help!
 




Hi,

COUNTA

Skip,
[sub]
[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue][/sub]
 
Have a look at the CountA function. It will count all non-null cells.

If you truly want to get to the number of text cells - that is, not counting cells containing numbers - then you could use something like:

=counta(A:A) - count(A:A)

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
Thank you! I never would have guessed it was that simple.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top