Calculating hours/minutes between time ranges

Status
Not open for further replies.

excelforeverything

New Member
Joined
Dec 10, 2018
Messages
2
Hello all,

I'm in dire need of finding a better solution to this problem:

I am in need of caclulating the time between multiple time ranges. Time Range A is a recurring schedule for the month of November, that allocates specific time slots to users, who are then allowed to login during these specific times slots. If the user happens to login outside of these time slots, goes over their allotted time slot or logins in before their allotted times slots then I need to calculate the hours/minutes that they are logged in anywhere outside of their assigned time slot. I am given a large log of the date and duration that users have logged in, which we will call Time Range B.

***Happy to upload excel file if necessary.

Example of Time Range A/Recurring Schedule:

[TABLE="width: 231"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]User Name[/TD]
[TD]Start time [/TD]
[TD] End time[/TD]
[/TR]
[TR]
[TD]User 1[/TD]
[TD]20:54 [/TD]
[TD] 23:59[/TD]
[/TR]
[TR]
[TD]User 1[/TD]
[TD]0:00[/TD]
[TD] 6:45[/TD]
[/TR]
[TR]
[TD]
User 1
[/TD]
[TD]9:32 [/TD]
[TD] 11:45[/TD]
[/TR]
[TR]
[TD]
User 1
[/TD]
[TD]19:38[/TD]
[TD] 21:35[/TD]
[/TR]
[TR]
[TD]User 2[/TD]
[TD]6:25[/TD]
[TD] 10:00[/TD]
[/TR]
</tbody>[/TABLE]

Example of Time Range B/User Log of Date/Duration:
[TABLE="width: 590"]
<colgroup><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD][TABLE="width: 590"]
<colgroup><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]User Name[/TD]
[TD]Start Time[/TD]
[TD]Start Date[/TD]
[TD]End Time[/TD]
[TD]End Date[/TD]
[TD]Duration[/TD]
[/TR]
[TR]
[TD]User 1[/TD]
[TD="align: right"]19:55:14[/TD]
[TD="align: right"]11/02/18[/TD]
[TD="align: right"] 20:57:02[/TD]
[TD="align: right"]11/02/18
[/TD]
[TD] 01:01:48[/TD]
[/TR]
[TR]
[TD]
User 1
[/TD]
[TD="align: right"]8:41:40[/TD]
[TD="align: right"]11/03/18[/TD]
[TD="align: right"] 11:56:10[/TD]
[TD="align: right"]11/03/18[/TD]
[TD] 03:14:30[/TD]
[/TR]
[TR]
[TD]
User 1
[/TD]
[TD="align: right"]11:44:16[/TD]
[TD="align: right"]11/04/18[/TD]
[TD="align: right"] 11:52:24[/TD]
[TD="align: right"]11/04/18[/TD]
[TD] 00:08:08[/TD]
[/TR]
[TR]
[TD]
User 1
[/TD]
[TD="align: right"]11:57:18[/TD]
[TD="align: right"]11/04/18[/TD]
[TD="align: right"] 12:50:40[/TD]
[TD="align: right"]11/04/18[/TD]
[TD] 00:53:22[/TD]
[/TR]
[TR]
[TD]
User 1
[/TD]
[TD="align: right"]11:07:00[/TD]
[TD="align: right"]11/05/18[/TD]
[TD="align: right"] 12:06:02[/TD]
[TD="align: right"]11/05/18 [/TD]
[TD] 00:59:02[/TD]
[/TR]
</tbody>[/TABLE]
<strike></strike>[TABLE="width: 590"]
<colgroup><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]
User 2
[/TD]
[TD="align: right"]17:55:37[/TD]
[TD="align: right"]11/20/18[/TD]
[TD="align: right"] 18:05:17[/TD]
[TD="align: right"]11/20/18[/TD]
[TD] 00:09:40[/TD]
[/TR]
[TR]
[TD]
User 2
[/TD]
[TD="align: right"]11:50:54[/TD]
[TD="align: right"]11/21/18[/TD]
[TD="align: right"] 13:36:32[/TD]
[TD="align: right"]11/21/18 [/TD]
[TD] 01:45:38[/TD]
[/TR]
[TR]
[TD]
User 2
[/TD]
[TD="align: right"]14:42:20[/TD]
[TD="align: right"]11/21/18[/TD]
[TD="align: right"] 16:02:36[/TD]
[TD="align: right"]11/21/18 [/TD]
[TD] 01:20:16[/TD]
[/TR]
[TR]
[TD]
User 2
[/TD]
[TD="align: right"]5:34:22[/TD]
[TD="align: right"]11/23/18[/TD]
[TD="align: right"]6:49:00[/TD]
[TD="align: right"]11/23/18[/TD]
[TD] 01:14:38[/TD]
[/TR]
[TR]
[TD]
User 2
[/TD]
[TD="align: right"]6:17:01[/TD]
[TD="align: right"]11/23/18[/TD]
[TD="align: right"]6:47:14[/TD]
[TD="align: right"]11/23/18[/TD]
[TD] 00:30:13[/TD]
[/TR]
[TR]
[TD]
User 2
[/TD]
[TD="align: right"]5:52:44[/TD]
[TD="align: right"]11/24/18[/TD]
[TD="align: right"]7:25:38[/TD]
[TD="align: right"]11/24/18[/TD]
[TD] 01:32:54[/TD]
[/TR]
</tbody>[/TABLE]
<strike></strike>[TABLE="width: 680"]
<colgroup><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[TD="align: right"][/TD]
[/TR]
</tbody>[/TABLE]
<strike></strike>
[/TD]
[TD]<strike></strike><strike></strike><strike></strike>
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 590"]
<colgroup><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
<strike>
</strike>
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Duplicate https://www.mrexcel.com/forum/excel...s-time-ranges-do-not-overlap.html#post5190485

Please do not post the same question multiple times. All clarifications, follow-ups, and bumps should be posted back to the original thread.
Per forum rules, posts of a duplicate nature will be locked or deleted (rule 12 here: Forum Rules).

Note that sometimes posts from new users require Moderator approval before you can see them on the public forums. When this happens, you should see a message to that effect when you try to post it.
Please be patient and do not attempt to post the question again.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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