Sumproduct with multiple row and column criteria

truebluewoman

New Member
Joined
Sep 26, 2014
Messages
36
I have been trying to solve this for about a week and cannot seem to figured this out. I have several sections of a worksheet that is for 10 types of work being performed, the status of the work, and an estimate of the cost of that work. It looks like this, but has a lot of other items in between (like Contractor, date scheduled, etc), so for the sake of brevity, I am simply showing the basic structure of the data:
Unit NumberEstimated CostStatusEstimated CostStatusEstimated CostStatus
Unit 1150.00In Progress300.00Completed0.00No Turn
Unit 2250.00Completed200.00Completed300.00Completed
Unit 30.00No Turn0.00No Turn15.00In Progress
PaintPaintCleaningCleaningCarpet RepairCarpet Repair

I am trying to sum the cost of the Paint Items that have been completed. I am able to write a formula for the overall estimated cost. That formula is the following:

Excel Formula:
SUM(INDEX(COSTESTIMATES,,MATCH("Estimated Cost"&$B13,'5 - Contractor Schedule'!$A$6:$DF$6&'5 - Contractor Schedule'!$A$541:$DF$541,0)))

I cannot seem to be able to figure out how to limit the rows to only those that are in "Completed" status. I thought that if I could insert the row numbers in between the two commas(after the "COSTESTIMATES" but before the "MATCH", it would then limit the results to those particular rows.

I have also tried using AGGREGATE, SUMIFS, and SUMPRODUCT, but I could not write anything that would result in what I need.

The following two SUMPRODUCT formulas give me each component, but I cannot combine them to limit the totals. I get zeros or VALUE! errors:

Sums the totals of the estimated costs for paint items
Excel Formula:
SUMPRODUCT(('5 - Contractor Schedule'!$A$541:$DF$541=$B13)*('5 - Contractor Schedule'!$A$6:$DF$6="Estimated Cost")*ISNUMBER(COSTESTIMATES),COSTESTIMATES)

Returns the number of completed paint items
Excel Formula:
SUMPRODUCT((COSTESTIMATES="Completed")*('5 - Contractor Schedule'!$A$541:$DF$541=$B13)*('5 - Contractor Schedule'!$A$6:$DF$6="Status"))

COSTESTIMATES= Named Range '5 - Contractor Schedule'!$A$6:$DF$536
$B13 = 'Paint'

If anyone can help me with this, I would be eternally grateful.
 

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
This was a tough one, but I figured this out by using FILTER with SUMPRODUCT.
The first FILTER gives me the completed and the second filter gives me the costs. I ended up tweaking the named range to exclude the headers as they did not need to be included in the actual range to be utilized.

Excel Formula:
=IFERROR(SUMPRODUCT((FILTER(CONTRACTORCOSTS,('5 - Contractor Schedule'!$A$541:$DF$541=CONCAT($B13," ",$C13))*('5 - Contractor Schedule'!$A$6:$DF$6="Status"))="Completed")
*(FILTER(CONTRACTORCOSTS,('5 - Contractor Schedule'!$A$541:$DF$541=CONCAT($B13," ",$C13))*('5 - Contractor Schedule'!$A$6:$DF$6="Estimated Cost")))),0)
 
Upvote 0
Solution

Forum statistics

Threads
1,224,818
Messages
6,181,150
Members
453,021
Latest member
Justyna P

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