bobbysmith

New Member
Joined
Jan 24, 2015
Messages
29
Was hope someone can assist with my formula. I cant understand why results are not showing up on 19:00 and end at 22:00 (Col H is just the intervals). I seems to shift down to start at 19:30 and end at 22:30 instead of starting at 19:00 and ending at 22:00 (start 1900-1930, end 2130-2200). Any insight is greatly appreciated.

Col A Col B Col C
start
stop
slot
19:00
22:00
5

<tbody>
</tbody>

=SUMPRODUCT(($A$2<=F1)*($B$2>F1)*$C$2)

F H I
6:00
6:00-6:30
0
6:30
6:30-7:00
0
7:00
7:00-7:30
0
7:30
7:30-8:00
0
8:00
8:00-8:30
0
8:30
8:30-9:00
0
9:00
9:00-9:30
0
9:30
9:30-10:00
0
10:00
10:00-10:30
0
10:30
10:30-11:00
0
11:00
11:00-11:30
0
11:30
11:30-12:00
0
12:00
12:00-12:30
0
12:30
12:30-13:00
0
13:00
13:00-13:30
0
13:30
13:30-14:00
0
14:00
14:00-14:30
0
14:30
14:30-15:00
0
15:00
15:00-15:30
0
15:30
15:30-16:00
0
16:00
16:00-16:30
0
16:30
16:30-17:00
0
17:00
17:00-17:30
0
17:30
17:30-18:00
0
18:00
18:00-18:30
0
18:30
18:30-19:00
0
19:00
19:00-19:30
0
19:30
19:30-20:00
5
20:00
20:00-20:30
5
20:30
20:30-21:00
5
21:00
21:00-21:30
5
21:30
21:30-22:00
5
22:00
22:00-22:30
5
22:30
22:30-23:00
0
23:00
23:00-
0

<tbody>
</tbody>
 
Re: Sumproduct help

Marcelo,
I think you are right. I misread the question. Your answer looks good to me.
 
Upvote 0

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Re: Sumproduct help

Not sure I understand. When I check it starts on row 27 (see below). When I put a number in cell H27 the formula picked it up.

ABCDEFGH
1StartStopSlot6:006:00-6:300
219:0022:00326:306:30-7:000
3327:007:00-7:300
47:307:30-8:000
58:008:00-8:300
6StartRow278:308:30-9:000
79:009:00-9:300
89:309:30-10:000
910:0010:00-10:300
1010:3010:30-11:000
1111:0011:00-11:300
1211:3011:30-12:000
1312:0012:00-12:300
1412:3012:30-13:000
1513:0013:00-13:300
1613:3013:30-14:000
1714:0014:00-14:300
1814:3014:30-15:000
1915:0015:00-15:300
2015:3015:30-16:000
2116:0016:00-16:300
2216:3016:30-17:000
2317:0017:00-17:300
2417:3017:30-18:000
2518:0018:00-18:300
2618:3018:30-19:000
2719:0019:00-19:302
2819:3019:30-20:005
2920:0020:00-20:305
3020:3020:30-21:005
3121:0021:00-21:305
3221:3021:30-22:005
3322:0022:00-22:305
3422:3022:30-23:000
3523:0023:000

<tbody>
</tbody>

Spreadsheet Formulas
CellFormula
C2=SUMIFS($H$1:$H$35,$F$1:$F$35,">="&$A$2,$F$1:$F$35,"<="&$B$2)
C3=SUMPRODUCT(($F$1:$F$35>=$A$2)*($F$1:$F$35<=$B$2),$H$1:$H$35)
C6{=MIN(IF($F$1:$F$35>=$A$2,ROW($F$1:$F$35)-ROW($F$1)+1))}

<tbody>
</tbody>
Formula Array:
Produce enclosing
{ } by entering
formula with CTRL+SHIFT+ENTER!

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

AHoyNC, Marcelo is correct A,B & C are given and formula should in Column H. The User enters A,B, & C. I need the Value in C to be copied to down the given Start and Stop based on entries in A & B. So if "C" was 5 slots, then Value 5 needs to start at Row 27 (1900-1930) and end (2130-2200) at Row 32 but for some reason its shifting down one Row. Again thank you and Marcelo's time.

I1 =SUMPRODUCT(($A$2<=F1)*($B$2>F1)*$C$2)
F I
6:006:00-6:300
6:306:30-7:000
7:007:00-7:300
7:307:30-8:000
8:008:00-8:300
8:308:30-9:000
9:009:00-9:300
9:309:30-10:000
10:0010:00-10:300
10:3010:30-11:000
11:0011:00-11:300
11:3011:30-12:000
12:0012:00-12:300
12:3012:30-13:000
13:0013:00-13:300
13:3013:30-14:000
14:0014:00-14:300
14:3014:30-15:000
15:0015:00-15:300
15:3015:30-16:000
16:0016:00-16:300
16:3016:30-17:000
17:0017:00-17:300
17:3017:30-18:000
18:0018:00-18:300
18:3018:30-19:000
19:0019:00-19:300
19:3019:30-20:005
20:0020:00-20:305
20:3020:30-21:005
21:0021:00-21:305
21:3021:30-22:005
22:0022:00-22:305
22:3022:30-23:000
23:0023:00-

<colgroup><col span="2"><col><col></colgroup><tbody>
</tbody>

<col style="width: 64px;"><col style="width: 64px;"><col style="width: 64px;"><col style="width: 40px;"><col style="width: 41px;"><col style="width: 85px;"><col style="width: 90px;"><col style="width: 64px;"></colgroup><tbody> </tbody>
 
Last edited:
Upvote 0
Re: Sumproduct help

Have you tried the formula in post 8 - no need of SUMPRODUCT
I1 copied down
=(F1>=A$2)*(B$2>=F1)*C$2

Worked perfectly for me (see gray area)

A
B
C
D
E
F
G
H
I
1
Start​
Stop​
Slot​
06:00​
6:00-6:30​
0​
2
19:00​
22:00​
5​
06:30​
6:30-7:00​
0​
3
07:00​
7:00-7:30​
0​
4
07:30​
7:30-8:00​
0​
5
08:00​
8:00-8:30​
0​
6
08:30​
8:30-9:00​
0​
7
09:00​
9:00-9:30​
0​
8
09:30​
9:30-10:00​
0​
9
10:00​
10:00-10:30​
0​
10
10:30​
10:30-11:00​
0​
11
11:00​
11:00-11:30​
0​
12
11:30​
11:30-12:00​
0​
13
12:00​
12:00-12:30​
0​
14
12:30​
12:30-13:00​
0​
15
13:00​
13:00-13:30​
0​
16
13:30​
13:30-14:00​
0​
17
14:00​
14:00-14:30​
0​
18
14:30​
14:30-15:00​
0​
19
15:00​
15:00-15:30​
0​
20
15:30​
15:30-16:00​
0​
21
16:00​
16:00-16:30​
0​
22
16:30​
16:30-17:00​
0​
23
17:00​
17:00-17:30​
0​
24
17:30​
17:30-18:00​
0​
25
18:00​
18:00-18:30​
0​
26
18:30​
18:30-19:00​
0​
27
19:00​
19:00-19:30​
5​
28
19:30​
19:30-20:00​
5​
29
20:00​
20:00-20:30​
5​
30
20:30​
20:30-21:00​
5​
31
21:00​
21:00-21:30​
5​
32
21:30​
21:30-22:00​
5​
33
22:00​
22:00-22:30​
5​
34
22:30​
22:30-23:00​
0​
35
23:00​
23:00​
0​
36

<tbody>
</tbody>


M.
 
Upvote 0
Re: Sumproduct help

If the formula above didn't work for you, check the value in A2
Click in A2
Take a look at the Formula Bar - you should see
19:00:00
not
19:00:01 or 19:00:02

M.
 
Upvote 0
Re: Sumproduct help

If the formula above didn't work for you, check the value in A2
Click in A2
Take a look at the Formula Bar - you should see
19:00:00
not
19:00:01 or 19:00:02

M.

I basically duplicated exactly as yours and still didnt work. I also checked the formula bar for A2 it shows 7:00:00 PM. No 01 or 02. It must be something with my excel settings maybe? using office pro 2010
 
Upvote 0
Re: Sumproduct help

I basically duplicated exactly as yours and still didnt work. I also checked the formula bar for A2 it shows 7:00:00 PM. No 01 or 02. It must be something with my excel settings maybe? using office pro 2010


I'm also using Excel 2010 pro.
Last check
Try in an empty cell
=A2=F27
tell us the result

M.
 
Upvote 0
Re: Sumproduct help

I'm also using Excel 2010 pro.
Last check
Try in an empty cell
=A2=F27
tell us the result

M.
this is my results after testing each row, the blanks are TRUE:
6:00
6:30
7:00
7:30
8:00
8:30
9:00
9:30
10:00
10:30
11:00
FALSE11:30
12:00
12:30
FALSE13:00
13:30
14:00
FALSE14:30
15:00
15:30
FALSE16:00
16:30
17:00
FALSE17:30
18:00
18:30
FALSE19:00
19:30
20:00
FALSE20:30
FALSE21:00
21:30
FALSE22:00
FALSE22:30
23:00

<colgroup><col width="64" span="2" style="width: 48pt;"></colgroup><tbody>
</tbody>

M.[/QUOTE]
 
Upvote 0
Re: Sumproduct help

Hi Marcelo

in an empty cell ......=A2=F27 = FALSE

Wow... we found the culprit!
Shouldn't 19:00 (A2) be equal to 19:00 (F27)?
Type 19:00 in F27 and see if the formula works.

M.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,443
Messages
6,124,890
Members
449,194
Latest member
JayEggleton

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