How do I use countif to count values excluding blank cells

G

Glenda

I am trying to get the percentage of 1's in a column excluding blank cells

A B
1 1 0
2 1 1
3
4 0

I know the formula would be =countif(a1:a4,1) answer would be 2 but, how do
I get the percent of the #1's with including blank cells.
 
D

Dave Peterson

=countif(a1:a4,1)/count(a1:a4)

=count() returns the number of numbers in the range.
 
D

Dave Peterson

Since the cell is empty, it won't be included in the =countif() and it won't be
included in the =count().

In fact, all non-numeric entries would be excluded from the =count() portion.

Am I missing something?
 

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