How to count the number of cells not empty?

E

Eric

I get a table from cell M2 to W200, and would like to count the number of
cells not empty? which the cell equals to "". Does anyone have any
suggestions?
Thanks in advance for any suggestions
Eric
 
E

Eric

it counts the empty cell too,
Do you have any suggestions on how to fix it?
Thanks in advance for any suggestions
Eric
 
E

Eric

="", which is not defined as empty cell in excel, so counta function does not
work for my case, do you have any more suggestions?
Thanks in advance for any suggestions
Eric
 
S

Sheeloo

=COUNTA(M2:W200) - COUNTIF(M2:W200,"")
Try

Eric said:
="", which is not defined as empty cell in excel, so counta function does not
work for my case, do you have any more suggestions?
Thanks in advance for any suggestions
Eric
 
T

T. Valko

Ok, I got this from your other post:
There is a table from cell M2 to W200, which
contains names and empty cell.

So, that means the range contains only TEXT.

Try this...

=COUNTIF(M2:W200,"?*")

That will count TEXT ONLY and will *exclude* from the count any cells that
contain formula blanks ="".
 
E

Eric

Whatif the cell contains number only, such as 1, -1, 0.
Do you have any suggestions?
Thank everyone very much for any suggestions
Eric
 
R

Ron Rosenfeld

I get a table from cell M2 to W200, and would like to count the number of
cells not empty? which the cell equals to "". Does anyone have any
suggestions?
Thanks in advance for any suggestions
Eric

Two different approaches:

=ROWS(M2:W200)*COLUMNS(M2:W200)-COUNTBLANK(M2:W200)


=SUMPRODUCT(--(LEN(M2:W200)>0))


--ron
 
T

T. Valko

Whatif the cell contains number only

For numbers *only* :

=COUNT(M2:W200)

For cells that contain either numbers or text and exclude formula blanks:

=COUNT(M2:W200)+COUNTIF(M2:W200,"?*")
 

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