PDA

View Full Version : sum with conditions



alienscript
10-17-2008, 09:49 AM
Hello Excel experts,

could someone please help me how I can use sumproduct to sum the cells with conditions? my conditions are:

1) if PartNum, PO_Num and PO_Line is the same in each line, take PO_Qty only once (put in Total_Qty).
2) if PartNum, PO_Num and PO_Line is not the same in each line, take the individual line's PO_Qty (put in Total_Qty).

PartNum PO_Num PO_Line PO_Qty Total_Qty

1234-A 4201777 000010 16 16
1234-A 4201777 000010 16
1234-A 4201777 000010 16
1234-F 4201777 000010 18 18
1234-F 4201777 000020 18 18
1234-F 4201777 000030 18 18
1234-B 4201666 000010 10 10
1235-C 4201666 000010 10 10
1234-C 4201555 000010 16 16
9934-C 4201555 000020 16 16

Bob Phillips
10-17-2008, 11:11 AM
In E2 enter

=IF(SUMPRODUCT(--($A$1:$A$11=$A2),--($B$1:$B$11=$B2),--($C$1:$C$11=$C2))=1,$D2,IF(AND($E1<>"",$E1<>$D2),$D2,""))

and copy down

alienscript
10-17-2008, 11:56 PM
you are brilliant! I cracked my head for so many hours and couldnt get it right. Thanks so much for your help.