SUMIFS with multiple criteria, ignoring blank cells in table data.

rings

New Member
Joined
Feb 27, 2018
Messages
3
Hi all. I have searched the forum for a solution to this but it's not coming to me. I have two tables, one is a plan, and the other is a report. In the plan I have Work Orders, Team names and planned hours by week. In the report (references a pivot table elsewhere) I have a work order, and hours charged by team. In the pivot table, I can filter out certain teams, which will then leave that section of the table blank (Row 14 in his example).What I'd like to be able to do is pull the planned hours base on the what's on the report. If the report cell is blank, ignore it in the SUM of planned hours, else, include it. Here's my data:

A1B1C1D1E1F1
A2Plan
A3Work OrderTeam30-Sep-187-Oct-1814-Oct-18
A4123Team 15.008.009.00
A5123Team 210.0010.008.00
A6123Team 35.008.0010.00
A7456Team 18.004.0012.00
A8456Team 212.0010.006.00
A9456Team 36.007.004.00
A10
A11
A12ReportWork Order123
A13Team30-Sep-187-Oct-1814-Oct-18
A14Team 18.005.008.00
A15Team 2
A16Team 37.007.009.00
A17ACTUALS15.0012.0017.00
A18PLAN5.008.000.00
A19123

<tbody>
</tbody>

In cell C18, I have only one Team criteria:
SUMIFS(INDEX($D$4:$F$9,,MATCH(C$13,$D$3:$F$3,0)),$B$4:$B$9,$D$12,$C$4:$C$9,IF(C$14="","<>",$B$14))

In cell D18, I have two Team criteria, one of which is blank. If I populate the blank team data, the formula does not work:
SUMIFS(INDEX($D$4:$F$9,,MATCH(D$13,$D$3:$F$3,0)),$B$4:$B$9,$D$12,$C$4:$C$9,IF(D$14="","<>",$B$14),$C$4:$C$9,IF(D$15="","<>",$B$15))

And last, in cell E8, I tried having all tree Team criteria, and as expected, it doesn't work either:
SUMIFS(INDEX($D$4:$F$9,,MATCH(E$13,$D$3:$F$3,0)),$B$4:$B$9,$D$12,$C$4:$C$9,IF(E$14="","<>",$B$14),$C$4:$C$9,IF(E$15="","<>",$B$15),$C$4:$C$9,IF(E$16="","<>",$B$16))

Is this something really simple that I'm missing? Thanks in advance.

EDIT:
The blank row is row 15, not row 14 as originally stated. The third formula is in cell E18, not E8. Sorry about that.
 
Last edited by a moderator:

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
So I poked around a little more and came up with an array formula that looks really dirty, but it works. If I place this formula into cell C18, it will sum up the planned hours for only the fields that have data in the report:
=SUM(IF(C$14="","0",(INDEX(INDEX($D$4:$F$9,,MATCH(C$13,$D$3:$F$3,0)),MATCH($D$12&$B$14,$B$4:$B$9&$C$4:$C$9,0)))),IF(C$15="","0",(INDEX(INDEX($D$4:$F$9,,MATCH(C$13,$D$3:$F$3,0)),MATCH($D$12&$B$15,$B$4:$B$9&$C$4:$C$9,0)))),IF(C$16="","0",(INDEX(INDEX($D$4:$F$9,,MATCH(C$13,$D$3:$F$3,0)),MATCH($D$12&$B$16,$B$4:$B$9&$C$4:$C$9,0)))))

There has to be a simpler way, right?
 
Upvote 0

Forum statistics

Threads
1,215,352
Messages
6,124,457
Members
449,161
Latest member
NHOJ

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