Sumproduct only if multiple criteria is met in multiple rows

John Luther

New Member
Joined
May 5, 2014
Messages
28
Hi,

I am trying to solve a problem using sumproduct but can't quite figure it out:

I have a table (illustrated below) in which I'm trying to sum the total cost (column D) when the status (column C) is equal to or greater than 6 for any particular customer (column B) on a work order (column A). So for this data set, I do not want a sum that includes row 2 for example, even though it meets all the criteria, because the same customer on the same work order in the next row, has a status of 4. I only want to sum the cost of the "complete" orders, when every row for a customer/work order is status 6 or 7. I can do this with a helper column but I want to avoid that if possible. I hope I've been able to communicate my problem effectively. I'd appreciate any help I can get.

ABCD
1WO
CUSTOMERSTATUSCOST
210/18/17ATLRAL6$395.00
310/18/17ATLRAL4$222.00
410/18/17BILSYL4$159.00
510/18/17DIATEM6$3,000.00
610/18/17DIATEM6$2,000.00
710/18/17ROBTAM5$223.00
810/18/17VALSAL6$50.00
910/18/17BILHOU5$1,852.00
1010/18/17BILHOU6$2,310.00
1110/25/17DAVSTO7$1,400.00
1210/25/17DIATEM4$2,796.00
1310/25/17FURJAM7$2,142.00
1410/25/17FURJAM7$499.00
1510/25/17FURJAM7$595.00
1610/25/17FURJAM7$838.00
SUM OF COMPLETED ORDERS=$10,524.00

<colgroup><col style="mso-width-source:userset;mso-width-alt:768;width:16pt" width="21"> <col style="width:65pt" width="86" span="3"> <col style="width:65pt" width="86"> </colgroup><tbody>
</tbody>

Thanks,

John
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hi John,
What about using Sumif?

Supposing the table starts from cell A1:

=SUMIF(D3:D17;">=6";E3:E17)

Does that work for you?

Best,
 
Upvote 0
honestly, I would use a Pivot Table....
Row LabelsCUSTOMERSTATUSSum of COST
10/18/2017ATLRAL6395
BILHOU62310
DIATEM65000
VALSAL650
10/25/2017DAVSTO71400
FURJAM74074
Grand Total13229

<tbody>
</tbody><colgroup><col><col><col><col></colgroup>
 
Last edited:
Upvote 0
I don't want to use a pivot table because I'm working with an existing document with a dashboard that I simply want to add this sum to.

I can use sumproduct to achieve get a sum of all cost for any particular customer on any particular work order, but what I can't figure out how do is get a sum of all customers on a work order that are status 6 or 7.
 
Upvote 0
I can get the result I want by adding two helper columns, one to concatenate work order and customer, and another that uses that concatenation and sumproduct to get the percentage of the order that is complete. I can then tally all the orders that are 100% complete. I'm still trying to figure out how to get my number more elegantly without the helper columns.

WOCUSTOMERSTATUSCOST
CONCATENATE(A2,B2)
SUMPRODUCT(($E$2:$E$16=E2)*($C$2:$C$16>5)*($D$2:$D$16))/SUMPRODUCT(($E$2:$E$16=E2)*($D$2:$D$16))
10/18/17ATLRAL6$395.0043026ATLRAL64.02%
10/18/17ATLRAL4$222.0043026ATLRAL64.02%
10/18/17BILSYL4$159.0043026BILSYL
0.00%
10/18/17DIATEM6$3,000.0043026DIATEM100.00%
10/18/17DIATEM6$2,000.0043026DIATEM100.00%
10/18/17ROBTAM5$223.0043026ROBTAM0.00%
10/18/17VALSAL6$50.0043026VALSAL100.00%
10/18/17BILHOU5$1,852.0043026BILHOU55.50%
10/18/17BILHOU6$2,310.0043026BILHOU55.50%
10/25/17DAVSTO7$1,400.0043033DAVSTO100.00%
10/25/17DIATEM4$2,796.0043033DIATEM0.00%
10/25/17FURJAM7$2,142.0043033FURJAM100.00%
10/25/17FURJAM7$499.0043033FURJAM100.00%
10/25/17FURJAM7$595.0043033FURJAM100.00%
10/25/17FURJAM7$838.0043033FURJAM100.00%
$10,524.00
SUMPRODUCT((F2:F16=1)*(D2:D16))

<colgroup><col span="3"><col><col><col></colgroup><tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,216,076
Messages
6,128,670
Members
449,463
Latest member
Jojomen56

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