View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Counting Data in Excel

=sumproduct(--(b2:b57="dla"),--(d2:d57=1))

Adjust the ranges to match--but you can't use whole columns.

=sumproduct() likes to work with numbers. The -- stuff changes trues and falses
to 1's and 0's.

Bob Phillips explains =sumproduct() in much more detail he
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html

Marilyn wrote:

I'm trying to count data based on the value in 2 columns. I'm using the
following formula =COUNTIF(B2:B57,"DLA")--COUNTIF(D2:D57,1) but it is giving
me the wrong count. Is there a way I can make this work?

Thanks,


--

Dave Peterson