Overlapping times and calculating actual hours worked

excelmonk

New Member
Joined
Jul 7, 2012
Messages
3
Hi All,

Here is my scenario. I have a list of employees and the time ranges of when they have worked on different appointments. This data comes in every day and I would consolidate files for each day using power query. The sample data is as follows


EmployeeScheduled_StartScheduled_End
ABC4/14/2020 9:004/14/2020 16:00
DEF4/14/2020 9:004/14/2020 16:00
DEF4/14/2020 11:004/14/2020 14:00
ABC4/14/2020 15:004/14/2020 17:00
ABC4/14/2020 16:004/14/2020 18:30

I'm trying to calculate how many hours an employee worked on a particular days excluding the overlap times.

So for example employee ABC has three entries and all of them have some overlap. And same is the case with employee DEF. I'm trying to find a solution where I can define New Start Time where the new start time gets rid of the overlap problem.

For example


EmployeeScheduled_StartScheduled_EndNew Start TimeNew End TimeHours Worked
ABC4/14/2020 9:004/14/2020 16:004/14/2020 9:004/14/2020 16:007
DEF4/14/2020 9:004/14/2020 16:004/14/2020 9:004/14/2020 16:007
DEF4/14/2020 11:004/14/2020 14:004/14/2020 16:004/14/2020 14:000
ABC4/14/2020 15:004/14/2020 17:004/14/2020 16:004/14/2020 17:001
ABC4/14/2020 16:004/14/2020 18:304/14/2020 17:004/14/2020 18:301.5

For employee ABC for row 4 New start time is End time for ABC in row 1 and same way new start time in row 5 is same as end time in row 4. I follow the same logic for DEF.
To calculate working hours I simply check with if condition whether start time > End Time. And if start time is greater than end time I just make it 0. For example second row for DEF.

I would have multiple rows with different employees in my data. Is there an excel formula to create the column New Start Time. I'm open to use Power Query as well as I'm currently using that to consolidate data every day

Thanks for your help in advance!
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!


Cross posted at: Overlapping times and calculating actual hours worked
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!


Cross posted at: Overlapping times and calculating actual hours worked
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
Thanks for the information. I will surely keep this in mind for future.
 
Upvote 0

Forum statistics

Threads
1,214,922
Messages
6,122,281
Members
449,075
Latest member
staticfluids

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