Sum-If with Multiple Criteria

jjramirez85

New Member
Joined
May 21, 2014
Messages
19
Hello,

In column C, I want the following action: forward calculation if the criteria is met but reverse calculation if other criteria is met. This is a two-way action.
[TABLE="width: 448"]
<colgroup><col span="7"></colgroup><tbody>[TR]
[TD="colspan: 7"]if from dept = "Step 1" & to dept ="Step 2", then QTY * WEIGHT[/TD]
[/TR]
[TR]
[TD="colspan: 7"]if from dept = "Step 2" & to dept ="Step 1", then QTY * WEIGHT (negative)[/TD]
[/TR]
</tbody>[/TABLE]


[TABLE="width: 618"]
<colgroup><col span="6"></colgroup><tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]FROM DEPT[/TD]
[TD]TO DEPT[/TD]
[TD]QTY[/TD]
[TD]WEIGHT[/TD]
[TD]TOTAL WEIGHT[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]STEP 1[/TD]
[TD]STEP 2[/TD]
[TD]10[/TD]
[TD]0.5[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]STEP 2[/TD]
[TD]STEP 1[/TD]
[TD]5[/TD]
[TD]0.75[/TD]
[TD]-3.75[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Not sure why you are repeating columns A, B, and C, I am proceeding with the assumption that QTY is in column D, WEIGHT is in column R, and TOTAL WEIGHT is in column E.

Then, in E2 enter this formula:
Code:
=IF(AND(B2="STEP 1",C2="STEP 2"),C2*D2,IF(AND(B2="STEP 2",C2="STEP 1"),-C2*D2,""))
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top