Hi guys! I'm new here so hello
I'm a complete newbie when it comes to excel, trying to figure out a way to make some of my tedious work automated...
I need a formula/macro (?) which calculates work hours wih night shifts and couple more oddities, found some examples for calculating night shifts but I've got no idea how to edit them into something that I need.
It could be 5 formulas as well, each for one output cell, since first one is solved with a simple =(B1-A1)*24
For input, I've got two cells - one has start date & hour and second has finish date & hour, both in yy-mm-dd hh:mm format
I need to calculate total work hours, divided between 5 output cells (in that specific order):
[1] Total sum of hours during that shift =(B1-A1)*24
[2] Sum of normal day hours
[3] Sum of normal night hours
[4] Sum of additional day hours
[5] Sum of additional night hours
Night hours are from 22.00 to 06.00. If a person works more than 12 hours, then every hour after those 12 hours is counted as an "additional hour".
If it's during day time it's a "additional day hour", during night it's "additional night hour".
There is also another thing. Because of couple weird reasons, sometimes the time is formatted missing or adding one minute - so 15:59 needs to become 16:00, and 16:01 needs to be 16.00.
This formula needs to take that into the account.
So for example:
John Doe || 2016-07-25 16.00 || 2016-07-26 04.59
should give us: [1] 13 || [2] 6 || [3] 6 || [4] 0 || [5] 1
Bookmarks