How do I count non-contiguous cells?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to use the countif function to add non-contigous cells but I am
getting an error. I want to count 4 cells on a sheet that have a value
greater than 0.
 
COUNTIF() doesn't work on disjoint ranges. The usual approach is to use
several COUNTIF()'s and add them up.
 
=SUMPRODUCT(COUNTIF(INDIRECT({"A2","B7","H9","I1"}),">0"))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Assign a RangeName to your non-contiguious range and try this......

=COUNT(YourRangeName)

Vaya con Dios,
Chuck, CABGx3
 

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

Back
Top