View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Sean Timmons Sean Timmons is offline
external usenet poster
 
Posts: 1,696
Default Countif: Multiple Columns

=SUMPRODUCT((B1:B4=0)*(C1:C4=0))

would work. Though because it's specifically 0, you need to ensure the
sumproduct only contains the actual rows of data, else it will also count
blanks as 0.

"bowriter" wrote:

Hi folks,

I have two ranges and am trying to count how many times "0" occurs
simultaneously in both.

Example:

A B C

X 0 0
Y 3 1
Z 5 0
XX 0 0

The countif should come back as "2" (2 values [x and xx] share 0 in
common)

I tried =Countif(B2:B100, "0") + Countif(C2:C100, "0"). That didn't
work even though one would think "+" should be an "and" and not an
"or" (Excel treated "+" as an "or" so that in the above example the
result came back as "3")

I've read in other help sites a pivot table would be the best tool to
use, but I really didn't want to get that complicated...it's a pretty
simple spredsheet.

Thanks for any help,

R.E. Kelly