count - conditions in two columns

K

Karol_Tom

Hello,

I try to use:
(H2312:H2323=H2322)*(D2307:D2322=4)
=SUM(IF(AND(H2312:H2323=H2322;D2307:D2322=4);1;0))

and more combinations for example with sumproduct (of course I try to
hit CTRL+SHIFT+ENTER combination), but it doesn't work (I only get error
or 0 which is incorrect value).

I have two columns - one with time (for example: 2010-09-01) and second
with number.
I want to count cells using two criterias.

Unfortunately I can't create pivot table (workbook is shared) to solve
my problem, so please help me.
 
D

Dave Peterson

Try:

=sumproduct(--(H2312:H2323=H2322),--(D2307:D2322=4))

Adjust the ranges to match--but you can't use whole columns (except in xl2007+).

=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 here:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

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

=========
If you're using xl2007+, there's a new =countifS() function that you may want to
read about in Excel's help.
 

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