Sumproduct with two conditions(or more)
For testing purposes...
You could apply Data|Filter|autofilter to that range (all those columns).
Show just the cells with Machine in column b, just the cells with Repairs in
column C and just the January 2006 dates in column A.
Then put =subtotal(9,j:j) in a helper cell.
======
Or use a helper cell with a formula like:
=if(and(b2="machine",c2="repairs",text(a2,"yyyymm" )="200601"),j2,0)
and drag down the column.
Then sum that column.
It looks like your formula is ok to me--maybe there's just more stuff than you
think.
hellZg8 wrote:
I'm not entirerly sure. I guess I still don't quite understanding how the
formula is actually working.
It looks for the Value "Machine" in the Array1 (B2:B2002) and then finds the
Dates
in Array2 (A2:A2002) then sums the adjacent cells corresponding with Array's
1 & 2.
It almost looks as though it is summing everything up.
"Dave Peterson" wrote:
Why do you think your formula didn't work?
hellZg8 wrote:
This is a formula that I have now
=sumproduct((B2:B2002)="Machine")*(Year(A2:A2002)= 2006)
*(Month(A2:A2002)=1)*J2:J2002)
this works great (thanks to every one on this forum)
any ways I would like to add another condition in there.I tried the
following but
holy what a number did I get
=sumproduct((B2:B2002="Machine")*(C2:C2002="Repair s")*(Year(A2:A2002)=2006)*(Month(A2:A2002)=1)*J2:J 2002)
any help in the right direction will be greatly apprec.
--
Dave Peterson
--
Dave Peterson
|