Sum data between specific day and opening/closing times

Thoron6

New Member
Joined
Oct 27, 2015
Messages
27
OK so I think I'm making this more complicated than it should be...

I have a list of data like the below (Table 2) and a separate table with the code opening and closing times which vary by day of the week (Table 1).


I'm looking to get a list of unique codes with the totals falling between the opening and closing times and a separate column for data that falls outside the opening and closing times each day. Eg.

Code | Total between times/day | Total outside of opening times.
123 xxx xxx
456 xxx xxx

Any help with the formula would be greatly appreciated.

Thanks

Table 1
[TABLE="width: 500"]
<tbody>[TR]
[TD]Code
[/TD]
[TD]Mon
[/TD]
[TD]Tue
[/TD]
[TD]Wed
[/TD]
[TD]Thur
[/TD]
[TD]Fri
[/TD]
[TD]Sat
[/TD]
[TD]Sun
[/TD]
[TD]Mon
[/TD]
[TD]Tue
[/TD]
[TD]Wed
[/TD]
[TD]Thur
[/TD]
[TD]Fri
[/TD]
[TD]Sat
[/TD]
[TD]Sun
[/TD]
[/TR]
[TR]
[TD]123
[/TD]
[TD]10:00
[/TD]
[TD]10:00
[/TD]
[TD]10:00
[/TD]
[TD]10:00
[/TD]
[TD]10:00
[/TD]
[TD]09:00
[/TD]
[TD]16:00
[/TD]
[TD]22:00
[/TD]
[TD]22:00
[/TD]
[TD]22:00
[/TD]
[TD]22:00
[/TD]
[TD]23:00
[/TD]
[TD]23:30
[/TD]
[TD]22:00
[/TD]
[/TR]
[TR]
[TD]456
[/TD]
[TD]10:00
[/TD]
[TD]10:00
[/TD]
[TD]10:00
[/TD]
[TD]10:00
[/TD]
[TD]10:00
[/TD]
[TD]09:00
[/TD]
[TD]11:00
[/TD]
[TD]22:00
[/TD]
[TD]22:00
[/TD]
[TD]22:00
[/TD]
[TD]22:00
[/TD]
[TD]23:00
[/TD]
[TD]23:30
[/TD]
[TD]22:00
[/TD]
[/TR]
[TR]
[TD]789
[/TD]
[TD]11:00
[/TD]
[TD]11:00
[/TD]
[TD]11:00
[/TD]
[TD]11:00
[/TD]
[TD]11:00
[/TD]
[TD]09:00
[/TD]
[TD]12:00
[/TD]
[TD]22:00
[/TD]
[TD]22:00
[/TD]
[TD]22:00
[/TD]
[TD]22:00
[/TD]
[TD]23:00
[/TD]
[TD]23:30
[/TD]
[TD]22:00
[/TD]
[/TR]
</tbody>[/TABLE]


Table 2
[TABLE="width: 500"]
<tbody>[TR]
[TD]Code
[/TD]
[TD]Day
[/TD]
[TD]00:30
[/TD]
[TD]01:00
[/TD]
[TD]01:30
[/TD]
[TD]02:00
[/TD]
[TD]02:30
[/TD]
[TD]03:00
[/TD]
[TD]03:30
[/TD]
[TD]04:00
[/TD]
[TD]04:30
[/TD]
[/TR]
[TR]
[TD]123
[/TD]
[TD]Mon
[/TD]
[TD]2.6
[/TD]
[TD]2.6
[/TD]
[TD]2.8
[/TD]
[TD]1.8
[/TD]
[TD]1.7
[/TD]
[TD]2.0
[/TD]
[TD]3.1
[/TD]
[TD]4.2
[/TD]
[TD]1.7
[/TD]
[/TR]
[TR]
[TD]123
[/TD]
[TD]Tue
[/TD]
[TD]2.3
[/TD]
[TD]3
[/TD]
[TD]6
[/TD]
[TD]7
[/TD]
[TD]7
[/TD]
[TD]8
[/TD]
[TD]11
[/TD]
[TD]10
[/TD]
[TD]7
[/TD]
[/TR]
[TR]
[TD]123
[/TD]
[TD]Wed
[/TD]
[TD]2
[/TD]
[TD]4
[/TD]
[TD]5
[/TD]
[TD]7
[/TD]
[TD]8
[/TD]
[TD]7
[/TD]
[TD]15
[/TD]
[TD]8
[/TD]
[TD]2
[/TD]
[/TR]
[TR]
[TD]456
[/TD]
[TD]Mon
[/TD]
[TD]3
[/TD]
[TD]4
[/TD]
[TD]5
[/TD]
[TD]9
[/TD]
[TD]8
[/TD]
[TD]6
[/TD]
[TD]14
[/TD]
[TD]8
[/TD]
[TD]3
[/TD]
[/TR]
[TR]
[TD]456
[/TD]
[TD]Tue
[/TD]
[TD]3
[/TD]
[TD]3
[/TD]
[TD]4
[/TD]
[TD]7
[/TD]
[TD]8
[/TD]
[TD]9
[/TD]
[TD]26
[/TD]
[TD]8
[/TD]
[TD]2
[/TD]
[/TR]
[TR]
[TD]456
[/TD]
[TD]Wed
[/TD]
[TD]2
[/TD]
[TD]3
[/TD]
[TD]6
[/TD]
[TD]5
[/TD]
[TD]8
[/TD]
[TD]10
[/TD]
[TD]20
[/TD]
[TD]8
[/TD]
[TD]1
[/TD]
[/TR]
[TR]
[TD]789
[/TD]
[TD]Mon
[/TD]
[TD]2
[/TD]
[TD]3
[/TD]
[TD]4
[/TD]
[TD]5
[/TD]
[TD]5
[/TD]
[TD]10
[/TD]
[TD]31
[/TD]
[TD]20
[/TD]
[TD]6
[/TD]
[/TR]
[TR]
[TD]789
[/TD]
[TD]Tue
[/TD]
[TD]2
[/TD]
[TD]3
[/TD]
[TD]5
[/TD]
[TD]2
[/TD]
[TD]5
[/TD]
[TD]18
[/TD]
[TD]12
[/TD]
[TD]4
[/TD]
[TD]6
[/TD]
[/TR]
[TR]
[TD]789
[/TD]
[TD]Wed
[/TD]
[TD]2
[/TD]
[TD]3
[/TD]
[TD]6
[/TD]
[TD]5
[/TD]
[TD]4
[/TD]
[TD]10
[/TD]
[TD]21
[/TD]
[TD]4
[/TD]
[TD]6
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Actually, that might be as complicated as you think it is! :eeek:

Here's what I came up with:

ABCDEFGHIJKLMNO
CodeTotal outside of opening times

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="bgcolor: #FAFAFA"]Code[/TD]
[TD="bgcolor: #FAFAFA"]Mon[/TD]
[TD="bgcolor: #FAFAFA"]Tue[/TD]
[TD="bgcolor: #FAFAFA"]Wed[/TD]
[TD="bgcolor: #FAFAFA"]Thur[/TD]
[TD="bgcolor: #FAFAFA"]Fri[/TD]
[TD="bgcolor: #FAFAFA"]Sat[/TD]
[TD="bgcolor: #FAFAFA"]Sun[/TD]
[TD="bgcolor: #FAFAFA"]Mon[/TD]
[TD="bgcolor: #FAFAFA"]Tue[/TD]
[TD="bgcolor: #FAFAFA"]Wed[/TD]
[TD="bgcolor: #FAFAFA"]Thur[/TD]
[TD="bgcolor: #FAFAFA"]Fri[/TD]
[TD="bgcolor: #FAFAFA"]Sat[/TD]
[TD="bgcolor: #FAFAFA"]Sun[/TD]

[TD="align: center"]2[/TD]
[TD="bgcolor: #FAFAFA, align: right"]123[/TD]
[TD="bgcolor: #FAFAFA, align: right"]1:30[/TD]
[TD="bgcolor: #FAFAFA, align: right"]10:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]10:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]10:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]10:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]9:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]16:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]22:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]22:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]22:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]22:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]23:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]23:30[/TD]
[TD="bgcolor: #FAFAFA, align: right"]22:00[/TD]

[TD="align: center"]3[/TD]
[TD="bgcolor: #FAFAFA, align: right"]456[/TD]
[TD="bgcolor: #FAFAFA, align: right"]10:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]10:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]10:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]10:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]10:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]9:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]11:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]22:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]22:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]22:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]22:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]23:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]23:30[/TD]
[TD="bgcolor: #FAFAFA, align: right"]22:00[/TD]

[TD="align: center"]4[/TD]
[TD="bgcolor: #FAFAFA, align: right"]789[/TD]
[TD="bgcolor: #FAFAFA, align: right"]11:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]11:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]3:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]11:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]11:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]9:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]12:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]22:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]22:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]22:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]22:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]23:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]23:30[/TD]
[TD="bgcolor: #FAFAFA, align: right"]22:00[/TD]

[TD="align: center"]5[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]6[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]7[/TD]
[TD="bgcolor: #FAFAFA"]Code[/TD]
[TD="bgcolor: #FAFAFA"]Day[/TD]
[TD="bgcolor: #FAFAFA, align: right"]0:30[/TD]
[TD="bgcolor: #FAFAFA, align: right"]1:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]1:30[/TD]
[TD="bgcolor: #FAFAFA, align: right"]2:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]2:30[/TD]
[TD="bgcolor: #FAFAFA, align: right"]3:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]3:30[/TD]
[TD="bgcolor: #FAFAFA, align: right"]4:00[/TD]
[TD="bgcolor: #FAFAFA, align: right"]4:30[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]8[/TD]
[TD="bgcolor: #FAFAFA, align: right"]123[/TD]
[TD="bgcolor: #FAFAFA"]Mon[/TD]
[TD="bgcolor: #FAFAFA, align: right"]2.6[/TD]
[TD="bgcolor: #FAFAFA, align: right"]2.6[/TD]
[TD="bgcolor: #FAFAFA, align: right"]2.8[/TD]
[TD="bgcolor: #FAFAFA, align: right"]1.8[/TD]
[TD="bgcolor: #FAFAFA, align: right"]1.7[/TD]
[TD="bgcolor: #FAFAFA, align: right"]2[/TD]
[TD="bgcolor: #FAFAFA, align: right"]3.1[/TD]
[TD="bgcolor: #FAFAFA, align: right"]4.2[/TD]
[TD="bgcolor: #FAFAFA, align: right"]1.7[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]9[/TD]
[TD="bgcolor: #FAFAFA, align: right"]123[/TD]
[TD="bgcolor: #FAFAFA"]Tue[/TD]
[TD="bgcolor: #FAFAFA, align: right"]2.3[/TD]
[TD="bgcolor: #FAFAFA, align: right"]3[/TD]
[TD="bgcolor: #FAFAFA, align: right"]6[/TD]
[TD="bgcolor: #FAFAFA, align: right"]7[/TD]
[TD="bgcolor: #FAFAFA, align: right"]7[/TD]
[TD="bgcolor: #FAFAFA, align: right"]8[/TD]
[TD="bgcolor: #FAFAFA, align: right"]11[/TD]
[TD="bgcolor: #FAFAFA, align: right"]10[/TD]
[TD="bgcolor: #FAFAFA, align: right"]7[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]10[/TD]
[TD="bgcolor: #FAFAFA, align: right"]123[/TD]
[TD="bgcolor: #FAFAFA"]Wed[/TD]
[TD="bgcolor: #FAFAFA, align: right"]2[/TD]
[TD="bgcolor: #FAFAFA, align: right"]4[/TD]
[TD="bgcolor: #FAFAFA, align: right"]5[/TD]
[TD="bgcolor: #FAFAFA, align: right"]7[/TD]
[TD="bgcolor: #FAFAFA, align: right"]8[/TD]
[TD="bgcolor: #FAFAFA, align: right"]7[/TD]
[TD="bgcolor: #FAFAFA, align: right"]15[/TD]
[TD="bgcolor: #FAFAFA, align: right"]8[/TD]
[TD="bgcolor: #FAFAFA, align: right"]2[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]11[/TD]
[TD="bgcolor: #FAFAFA, align: right"]456[/TD]
[TD="bgcolor: #FAFAFA"]Mon[/TD]
[TD="bgcolor: #FAFAFA, align: right"]3[/TD]
[TD="bgcolor: #FAFAFA, align: right"]4[/TD]
[TD="bgcolor: #FAFAFA, align: right"]5[/TD]
[TD="bgcolor: #FAFAFA, align: right"]9[/TD]
[TD="bgcolor: #FAFAFA, align: right"]8[/TD]
[TD="bgcolor: #FAFAFA, align: right"]6[/TD]
[TD="bgcolor: #FAFAFA, align: right"]14[/TD]
[TD="bgcolor: #FAFAFA, align: right"]8[/TD]
[TD="bgcolor: #FAFAFA, align: right"]3[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]12[/TD]
[TD="bgcolor: #FAFAFA, align: right"]456[/TD]
[TD="bgcolor: #FAFAFA"]Tue[/TD]
[TD="bgcolor: #FAFAFA, align: right"]3[/TD]
[TD="bgcolor: #FAFAFA, align: right"]3[/TD]
[TD="bgcolor: #FAFAFA, align: right"]4[/TD]
[TD="bgcolor: #FAFAFA, align: right"]7[/TD]
[TD="bgcolor: #FAFAFA, align: right"]8[/TD]
[TD="bgcolor: #FAFAFA, align: right"]9[/TD]
[TD="bgcolor: #FAFAFA, align: right"]26[/TD]
[TD="bgcolor: #FAFAFA, align: right"]8[/TD]
[TD="bgcolor: #FAFAFA, align: right"]2[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]13[/TD]
[TD="bgcolor: #FAFAFA, align: right"]456[/TD]
[TD="bgcolor: #FAFAFA"]Wed[/TD]
[TD="bgcolor: #FAFAFA, align: right"]2[/TD]
[TD="bgcolor: #FAFAFA, align: right"]3[/TD]
[TD="bgcolor: #FAFAFA, align: right"]6[/TD]
[TD="bgcolor: #FAFAFA, align: right"]5[/TD]
[TD="bgcolor: #FAFAFA, align: right"]8[/TD]
[TD="bgcolor: #FAFAFA, align: right"]10[/TD]
[TD="bgcolor: #FAFAFA, align: right"]20[/TD]
[TD="bgcolor: #FAFAFA, align: right"]8[/TD]
[TD="bgcolor: #FAFAFA, align: right"]1[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]14[/TD]
[TD="bgcolor: #FAFAFA, align: right"]789[/TD]
[TD="bgcolor: #FAFAFA"]Mon[/TD]
[TD="bgcolor: #FAFAFA, align: right"]2[/TD]
[TD="bgcolor: #FAFAFA, align: right"]3[/TD]
[TD="bgcolor: #FAFAFA, align: right"]4[/TD]
[TD="bgcolor: #FAFAFA, align: right"]5[/TD]
[TD="bgcolor: #FAFAFA, align: right"]5[/TD]
[TD="bgcolor: #FAFAFA, align: right"]10[/TD]
[TD="bgcolor: #FAFAFA, align: right"]31[/TD]
[TD="bgcolor: #FAFAFA, align: right"]20[/TD]
[TD="bgcolor: #FAFAFA, align: right"]6[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]15[/TD]
[TD="bgcolor: #FAFAFA, align: right"]789[/TD]
[TD="bgcolor: #FAFAFA"]Tue[/TD]
[TD="bgcolor: #FAFAFA, align: right"]2[/TD]
[TD="bgcolor: #FAFAFA, align: right"]3[/TD]
[TD="bgcolor: #FAFAFA, align: right"]5[/TD]
[TD="bgcolor: #FAFAFA, align: right"]2[/TD]
[TD="bgcolor: #FAFAFA, align: right"]5[/TD]
[TD="bgcolor: #FAFAFA, align: right"]18[/TD]
[TD="bgcolor: #FAFAFA, align: right"]12[/TD]
[TD="bgcolor: #FAFAFA, align: right"]4[/TD]
[TD="bgcolor: #FAFAFA, align: right"]6[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]16[/TD]
[TD="bgcolor: #FAFAFA, align: right"]789[/TD]
[TD="bgcolor: #FAFAFA"]Wed[/TD]
[TD="bgcolor: #FAFAFA, align: right"]2[/TD]
[TD="bgcolor: #FAFAFA, align: right"]3[/TD]
[TD="bgcolor: #FAFAFA, align: right"]6[/TD]
[TD="bgcolor: #FAFAFA, align: right"]5[/TD]
[TD="bgcolor: #FAFAFA, align: right"]4[/TD]
[TD="bgcolor: #FAFAFA, align: right"]10[/TD]
[TD="bgcolor: #FAFAFA, align: right"]21[/TD]
[TD="bgcolor: #FAFAFA, align: right"]4[/TD]
[TD="bgcolor: #FAFAFA, align: right"]6[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]17[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]18[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]19[/TD]

[TD="bgcolor: #FAFAFA"]Total between times/day[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]20[/TD]
[TD="align: right"]123[/TD]
[TD="align: right"]17.3[/TD]
[TD="align: right"]124.5[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]21[/TD]
[TD="align: right"]456[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]193[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]22[/TD]
[TD="align: right"]789[/TD]
[TD="align: right"]41[/TD]
[TD="align: right"]163[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

</tbody>
Sheet9

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: #DAE7F5"]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: #DAE7F5"]C20[/TH]
[TD="align: left"]=SUMPRODUCT($C$8:$K$16*($A$8:$A$16=$A20))-B20[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Array Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: #DAE7F5"]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: #DAE7F5"]B20[/TH]
[TD="align: left"]{=SUMPRODUCT(($C$8:$K$16)*($A$8:$A$16=$A20)*($C$7:$K$7>=SUBTOTAL(9,OFFSET($B$2,MATCH($A20,$A$2:$A$4,0)-1,MATCH($B$8:$B$16,$B$1:$H$1,0)-1)))*($C$7:$K$7<=SUBTOTAL(9,OFFSET($I$2,MATCH($A20,$A$2:$A$4,0)-1,MATCH($B$8:$B$16,$I$1:$O$1,0)-1))))}[/TD]
[/TR]
</tbody>[/TABLE]
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself[/TD]
[/TR]
</tbody>[/TABLE]



Change your references to match your workbook. You can see that I've changed a few times for testing. Let me know how this works.
 
Upvote 0
Thank you Eric,

I'm not getting an error with the above but I am getting 0's for everything. I have adapted to my Spread sheet as per the below:

{=SUMPRODUCT(('Profile data'!$G$2:$BB$22815)*('Profile data'!$B$2:$B$22815=Summary!$A2)*('Profile data'!$G$1:$BB$1>=SUBTOTAL(9,OFFSET('NEW 12-12-16'!$C$3,MATCH(Summary!$A2,'NEW 12-12-16'!$A$3:$A$1745,0)-1,MATCH('Profile data'!$F$2:$F$22815,'NEW 12-12-16'!$C$2:$I$2,0)-1)))*('Profile data'!$G$1:$BB$1<=SUBTOTAL(9,OFFSET('NEW 12-12-16'!$J$3,MATCH(Summary!$A2,'NEW 12-12-16'!$A$3:$A$1745,0)-1,MATCH('Profile data'!$F$2:$F$22815,'NEW 12-12-16'!$J$2:$P$2,0)-1))))}

I'm wondering if it's because the cell referencing the Monday opening time (I2 in your data) is locked? However, this should still work and bring data back for one day. I will keep trying because I don't think it's too far off at all but all are returning "0" at present.

Thank you!
 
Upvote 0
I haven't tested your version yet, but it appears to be a match for mine, with the ranges adapted. The locked cell shouldn't matter. Are you entering the formula as an array formula? By which I mean you are entering it using Control+Shift+Enter, and not just manually entering the {} ?
 
Upvote 0
Hi Eric, Yes, I am putting it as an array formula. If the start time is locked, will it take into account different opening times for other properties or all follow the same opening/closing times? I believe it was like for like so can't understand the "0" result but I'll try again later to make sure it is the same. Were you getting the correct results on your example?

Thanks again
 
Upvote 0
The formula should take into account different starting times for each property, regardless of whether the start time is locked. Yes, I did get correct results on my example. I've tried rebuilding your formula, splitting the parts among 3 sheets like you did, but I'm having trouble lining things up. Could you post what the first dozen lines or so from each sheet look like?
 
Upvote 0
Thank you Eric,

Sorry it's been a while but I had a look and it wasn't working because the time formats were not the same. After making sure they were the same format the formula worked fine. Thank you for your help!
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,313
Members
452,634
Latest member
cpostell

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