Excel guru's,
I am trying to do an array formula similar to sumifs() but I have horizontal and vertical criteria. The formula I know and LOVE is the sum-if array [{=sum(if((.....)*(.....),(......)))}] but this only works if the array range is exactly the same vertically or horizontally, i.e. A2:A50 or Q2:Q50 or P2:P50.
The problem I am having is I need to sum the number of hours employees have worked in a week in a report I am creating, however the issue I have is the employee list in the summary sheet may change from time to time due to employees coming or going. See below a basic set-up similar to what I am running:
[TABLE="width: 647"]
<colgroup><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD] [/TD]
[TD="align: center"]John Smith[/TD]
[TD="align: center"]Jane Smith[/TD]
[TD="align: center"]Peter Johnson[/TD]
[TD="align: center"]Jo Blow[/TD]
[TD="align: center"]Peter Bloke[/TD]
[TD="align: center"]Jane Thompson[/TD]
[TD="align: center"]Jake Brake[/TD]
[/TR]
[TR]
[TD="align: center"]1/10/2014[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD="align: center"]2/10/2014[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD="align: center"]3/10/2014[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD="align: center"]4/10/2014[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD="align: center"]5/10/2014[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[/TR]
[TR]
[TD="align: center"]6/10/2014[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[/TR]
[TR]
[TD="align: center"]7/10/2014[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD="align: center"]8/10/2014[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[/TR]
[TR]
[TD="align: center"]9/10/2014[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]4[/TD]
[/TR]
[TR]
[TD="align: center"]10/10/2014[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD="align: center"]11/10/2014[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[/TR]
[TR]
[TD="align: center"]12/10/2014[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD="align: center"]13/10/2014[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[/TR]
[TR]
[TD="align: center"]14/10/2014[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[/TR]
[TR]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[/TR]
[TR]
[TD="align: center"] [/TD]
[TD="align: center"]Weekly Start[/TD]
[TD="align: center"]4/10/2014[/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[/TR]
[TR]
[TD="align: center"] [/TD]
[TD="align: center"]Week End[/TD]
[TD="align: center"]10/10/2014[/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[/TR]
[TR]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[/TR]
[TR]
[TD="align: center"] [/TD]
[TD="align: center"]Hours Worked[/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[/TR]
[TR]
[TD]Jane Smith[/TD]
[TD]48[/TD]
[TD="colspan: 6"]{=SUM(IF(($B$3:$B$16>=$D$19)*($B$3:$B$16<=$D$20),(D$3:D$16)))}[/TD]
[/TR]
[TR]
[TD]Jo Blow[/TD]
[TD]12[/TD]
[TD="colspan: 6"]{=SUM(IF(($B$3:$B$16>=$D$19)*($B$3:$B$16<=$D$20),(E$3:E$16)))}[/TD]
[/TR]
[TR]
[TD]John Smith[/TD]
[TD]48[/TD]
[TD="colspan: 6"]{=SUM(IF(($B$3:$B$16>=$D$19)*($B$3:$B$16<=$D$20),(C$3:C$16)))}[/TD]
[/TR]
[TR]
[TD]Peter Bloke[/TD]
[TD]60[/TD]
[TD="colspan: 6"]{=SUM(IF(($B$3:$B$16>=$D$19)*($B$3:$B$16<=$D$20),(F$3:F$16)))}[/TD]
[/TR]
</tbody>[/TABLE]
Now the problem is, the employee list to report may change (based on no criteria at all) to (for example):
[TABLE="width: 96"]
<colgroup><col></colgroup><tbody>[TR]
[TD]Jane Thompson[/TD]
[/TR]
[TR]
[TD]Jo Blow[/TD]
[/TR]
[TR]
[TD]John Smith[/TD]
[/TR]
[TR]
[TD]Peter Bloke[/TD]
[/TR]
[TR]
[TD]Peter Johnson
or next week
[TABLE="width: 96"]
<colgroup><col></colgroup><tbody>[TR]
[TD]Jake Brake[/TD]
[/TR]
[TR]
[TD]Jane Smith[/TD]
[/TR]
[TR]
[TD]Jane Thompson[/TD]
[/TR]
[TR]
[TD]Peter Bloke[/TD]
[/TR]
[TR]
[TD]Peter Johnson[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
Suggestions would be much appreciated.
regards.
I am trying to do an array formula similar to sumifs() but I have horizontal and vertical criteria. The formula I know and LOVE is the sum-if array [{=sum(if((.....)*(.....),(......)))}] but this only works if the array range is exactly the same vertically or horizontally, i.e. A2:A50 or Q2:Q50 or P2:P50.
The problem I am having is I need to sum the number of hours employees have worked in a week in a report I am creating, however the issue I have is the employee list in the summary sheet may change from time to time due to employees coming or going. See below a basic set-up similar to what I am running:
[TABLE="width: 647"]
<colgroup><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD] [/TD]
[TD="align: center"]John Smith[/TD]
[TD="align: center"]Jane Smith[/TD]
[TD="align: center"]Peter Johnson[/TD]
[TD="align: center"]Jo Blow[/TD]
[TD="align: center"]Peter Bloke[/TD]
[TD="align: center"]Jane Thompson[/TD]
[TD="align: center"]Jake Brake[/TD]
[/TR]
[TR]
[TD="align: center"]1/10/2014[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD="align: center"]2/10/2014[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD="align: center"]3/10/2014[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD="align: center"]4/10/2014[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD="align: center"]5/10/2014[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[/TR]
[TR]
[TD="align: center"]6/10/2014[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[/TR]
[TR]
[TD="align: center"]7/10/2014[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD="align: center"]8/10/2014[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[/TR]
[TR]
[TD="align: center"]9/10/2014[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]4[/TD]
[/TR]
[TR]
[TD="align: center"]10/10/2014[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD="align: center"]11/10/2014[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[/TR]
[TR]
[TD="align: center"]12/10/2014[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD="align: center"]13/10/2014[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[/TR]
[TR]
[TD="align: center"]14/10/2014[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[/TR]
[TR]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[/TR]
[TR]
[TD="align: center"] [/TD]
[TD="align: center"]Weekly Start[/TD]
[TD="align: center"]4/10/2014[/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[/TR]
[TR]
[TD="align: center"] [/TD]
[TD="align: center"]Week End[/TD]
[TD="align: center"]10/10/2014[/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[/TR]
[TR]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[/TR]
[TR]
[TD="align: center"] [/TD]
[TD="align: center"]Hours Worked[/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[TD="align: center"] [/TD]
[/TR]
[TR]
[TD]Jane Smith[/TD]
[TD]48[/TD]
[TD="colspan: 6"]{=SUM(IF(($B$3:$B$16>=$D$19)*($B$3:$B$16<=$D$20),(D$3:D$16)))}[/TD]
[/TR]
[TR]
[TD]Jo Blow[/TD]
[TD]12[/TD]
[TD="colspan: 6"]{=SUM(IF(($B$3:$B$16>=$D$19)*($B$3:$B$16<=$D$20),(E$3:E$16)))}[/TD]
[/TR]
[TR]
[TD]John Smith[/TD]
[TD]48[/TD]
[TD="colspan: 6"]{=SUM(IF(($B$3:$B$16>=$D$19)*($B$3:$B$16<=$D$20),(C$3:C$16)))}[/TD]
[/TR]
[TR]
[TD]Peter Bloke[/TD]
[TD]60[/TD]
[TD="colspan: 6"]{=SUM(IF(($B$3:$B$16>=$D$19)*($B$3:$B$16<=$D$20),(F$3:F$16)))}[/TD]
[/TR]
</tbody>[/TABLE]
Now the problem is, the employee list to report may change (based on no criteria at all) to (for example):
[TABLE="width: 96"]
<colgroup><col></colgroup><tbody>[TR]
[TD]Jane Thompson[/TD]
[/TR]
[TR]
[TD]Jo Blow[/TD]
[/TR]
[TR]
[TD]John Smith[/TD]
[/TR]
[TR]
[TD]Peter Bloke[/TD]
[/TR]
[TR]
[TD]Peter Johnson
or next week
[TABLE="width: 96"]
<colgroup><col></colgroup><tbody>[TR]
[TD]Jake Brake[/TD]
[/TR]
[TR]
[TD]Jane Smith[/TD]
[/TR]
[TR]
[TD]Jane Thompson[/TD]
[/TR]
[TR]
[TD]Peter Bloke[/TD]
[/TR]
[TR]
[TD]Peter Johnson[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
Suggestions would be much appreciated.
regards.