Counting text in a column

P

Paul H

I would like to count the text in a column, (each text would count as 1), the
column contains a simple "If" statement that will return either a name or a
blank. The text counting solutions I see in these posts also count the If
statement as 1.
 
G

Gary''s Student

If A1 thru A10 contain either text or formulas returning a blank, then:

=COUNTA(A1:A10)-COUNTBLANK(A1:A10)
 
P

Paul H

Gary and Bob, your solution is counting the "If" statement in the cells. I
have 1 name (Text) and 30 blank cells and your formula returns 31?
 
G

Gary''s Student

The solution the Bob & I proposed will work for a block of cells none of
which are truly empty; that is they all will have text showing or have a
formula returning a blank.

If this is not the case and the block of cells has both cells with visible
text and cells that are truly empty, then just use the COUNTA() function.
 
P

Paul H

Don't know what going on, your suggested formula doesn't work, the "If"
statements is =IF(B17=0,C18," ") the formula counts this cell even when the
results are blank, is my If statement causing the problem?
 
G

Gary''s Student

You have solved it!!!

Use:

=IF(B17=0,C18,"")

instead of:

=IF(B17=0,C18," ")
 
D

David Biddulph

Yes. Isn't it strange that COUNTBLANK and ISBLANK have different ways of
treating the empty string ""?
 

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