Count Time Entries VBA

healey21

Well-known Member
Joined
Dec 22, 2009
Messages
900
I have been asked if this is possible, A column holds date and time entries and we have been asked to count entries for every 15 minutes from the first entry and then show the count in the column to the right, I suspect that this can only be done via VBA but not sure of the approach. A sample is shown below:

Excel Workbook
BCD
1Time CompletedTotal Count Every 15 MinsComment
219/08/2011 15:30
319/08/2011 15:31
419/08/2011 15:32
519/08/2011 15:33
619/08/2011 15:35
719/08/2011 15:37
819/08/2011 15:40
919/08/2011 15:42
1019/08/2011 15:43
1119/08/2011 15:4410Because start time is 15:30
1219/08/2011 15:48
1319/08/2011 15:50
1419/08/2011 15:52
1519/08/2011 15:53
1619/08/2011 15:55
1719/08/2011 15:566Because start time is 15:48
1819/08/2011 16:03
1919/08/2011 16:04
2019/08/2011 16:08
2119/08/2011 16:11
2219/08/2011 16:16
2319/08/2011 16:176Because start time is 16:04
2419/08/2011 16:19
2519/08/2011 16:20
2619/08/2011 16:22
2719/08/2011 16:23
Time Count
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Put this in C2 and drag down.

Code:
=IF(B3="","",IF(MINUTE(B3-IF(COUNT($C$1:C1),INDEX(B:B,MATCH(999,$C$1:C1,1)+1),$B$2))>=15,
                   ROW()-IF(COUNT($C$1:C1),MATCH(999,$C$1:C1,1),1),""))
 
Upvote 0
Thank you AlphaFrog this works a treat. I have extended this through the thousands of rows.:)
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,882
Members
452,948
Latest member
Dupuhini

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