count cells in a document, but excude cells with a "0"

R

R.M.

I want to count the number of cells that have a value greater than "0", but
not use a range. The cells that will be counted are every other cell in that
column.

EX:

45
22<--
18
6<--
9
17<--
2
0<--

so my answer would be "3", the amount of cells that have a value greater
than "0". the arrows are not on the work sheet they are just used to point
out which cell I need counted.
 
J

Jim Thomlinson

You have not given any cell references where your data is but a fomual like
this should be close...

=SUMPRODUCT(--(MOD(ROW($A$1:$A$10), 2) = 0), --($A$1:$A$10<>0))

It looks at cells on even rows in A1:A10 and counts those cells that are not
equal to zero. To look at odd rows use MOD(ROW($A$1:$A$10), 2) <> 0
 

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