Spread hours/min over 15 min time intervals

chrono2483

Board Regular
Joined
Aug 23, 2014
Messages
164
Office Version
  1. 2016
Hello,

I am looking to see if it is possible to take a value representing hours/min and break it up into 15 min interval. From here, add each 15 min interval to the corresponding section (and continue to tally if there are multiples for that section).

Ex.

1) Start = 19:00 End = 22:00 (3 hrs)
2) Start = 19:00 End = 20:30 (1.5 hrs)
3) Start = 20:00 End = 23:00 (3 hrs)

I use a formula to convert into a # (3, 1, 3 respectively). What I then want to do is break these hrs into 15 min intervals and tally them against a time chart:


A
B
18:30
0
18:45
0
19:00
2
19:15
2
19:30
2
19:45
2
20:00
3
20:15
3
20:30
2
20:45
2
21:00
2
21:15
2
21:30
2
21:45
2
22:00
1
22:15
1
22:30
1
22:45
1
23:00
0
23:15
0
23:30
0

<tbody>
</tbody>

Is there a way to do this? I'm thinking a combination of index/match, to match the times with the hours?

Thanks!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Sorry, I didn't understand your request, and found the table hard to relate to the initial phrase.
So if you don't receive useful suggestions I should recommend that you rewrite your need, specifying which area your initial data and which results you are looking for.

Bye
 
Upvote 0
Maybe ...

Row\Col
A​
B​
C​
D​
E​
F​
G​
1​
Start
19:00​
19:00​
20:00​
2​
End
22:00​
20:30​
23:00​
3​
Time
4​
18:30​
00:00
00:00
00:00
00:00
B4 and across and down: =MAX(0, MIN(B$2, $A4 + "0:15") - MAX(B$1, $A4))
5​
18:45​
00:00
00:00
00:00
00:00
E4 and down: =SUM(B4:D4)
6​
19:00​
00:15
00:15
00:00
00:30
7​
19:15​
00:15
00:15
00:00
00:30
8​
19:30​
00:15
00:15
00:00
00:30
9​
19:45​
00:15
00:15
00:00
00:30
10​
20:00​
00:15
00:15
00:15
00:45
11​
20:15​
00:15
00:15
00:15
00:45
12​
20:30​
00:15
00:00
00:15
00:30
13​
20:45​
00:15
00:00
00:15
00:30
14​
21:00​
00:15
00:00
00:15
00:30
15​
21:15​
00:15
00:00
00:15
00:30
16​
21:30​
00:15
00:00
00:15
00:30
17​
21:45​
00:15
00:00
00:15
00:30
18​
22:00​
00:00
00:00
00:15
00:15
19​
22:15​
00:00
00:00
00:15
00:15
20​
22:30​
00:00
00:00
00:15
00:15
21​
22:45​
00:00
00:00
00:15
00:15
22​
23:00​
00:00
00:00
00:00
00:00
23​
23:15​
00:00
00:00
00:00
00:00
24​
23:30​
00:00
00:00
00:00
00:00
 
Upvote 0
Sorry - I hope this helps clarify (including a snapshot of the actual spreadsheet). To explain the image below:

- Col A will remain the same, with the time in 15 min intervals
- Col O & P are taken from another spreadsheet. The values will vary based on the data being pulled, but each row in O/P will have a start and end time
- Col Q is the number of hours between O & P, in number form (instead of time)
- Col B is what I want to do/retrieve. The example below is only focusing on the time interval 1600-1645. Based on the data pulled in O & P, and knowing the number of intervals using the data in Q, I want to be able to sum/tally in Col B. So, with O3/P3 there is 3.5 hrs (14 intervals). Therefore, I want each interval in Col B to keep track of that (a running tally, adding 1 for each occurrence) starting in B38 to B51. It will scroll through the data in O/P and tally each occurrence in B.

I hope that helps explain better? I like the idea of MAX/MIN, and will play with that to see if I can accomplish my goal - but with the info above, any additional suggestions?

 
Upvote 0
Giving Countif and Sumproduct a try, but seems tedious to have to do using formulas for each time interval
 
Upvote 0
I think the below formula should do the job:
Code:
=SUMPRODUCT(--(A2>=$O$2:$O$70),--(A3<=$P$2:$P$70))
Put it in B2 and copy down.
You need also to insert in A70 the end period for the slot starting in A69, ie 24:00 (probably this will display as 00:00, don't get confused).
For the formula to work, information in col A, O & P must be in pure hours; to check if this is true, format those columns as Numbers with 3 Decimals: they should display as numbers from 0.000 (00:00) to 1.000 (24:00).

Bye
 
Upvote 0
Try

=COUNTIFS($O$2:$O$69,"<="&A2,$P$2:$P$69,">"&A2)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,731
Messages
6,132,395
Members
449,725
Latest member
Enero1

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