I'm working on what is essentially a timesheet to help a friend calculate expected pay, but I've run into a roadblock in one area and would appreciate some help.
I have a date/time when she punches in and another when she punches out. Calculating total time spent on the job is easy, but I also need to know how many hours (if any) were spent working during a certain "golden time" period of the day. To make matters more complicated, this period is typically 11PM - 5AM, so the overnight issue complicates things.
For example, if she punches in at 7PM and punches out at 7AM the next day, she worked 12 hours total and 6 hours in the period 11AM - 5AM. If she works 12PM to 12AM, there's only 1 hour of "golden time". Essentially I want to sum the intersection of hours worked and the "golden time" period.
For optimum flexibility, I'd like to avoid hardcoding the definition of the "golden time" period. There's also the potential for 18 or 24 hour shifts so there may be multiple passes through the "golden time" period. I realize this may be more of a math problem than an Excel problem, but any help would be appreciated. Thanks!
I have a date/time when she punches in and another when she punches out. Calculating total time spent on the job is easy, but I also need to know how many hours (if any) were spent working during a certain "golden time" period of the day. To make matters more complicated, this period is typically 11PM - 5AM, so the overnight issue complicates things.
For example, if she punches in at 7PM and punches out at 7AM the next day, she worked 12 hours total and 6 hours in the period 11AM - 5AM. If she works 12PM to 12AM, there's only 1 hour of "golden time". Essentially I want to sum the intersection of hours worked and the "golden time" period.
For optimum flexibility, I'd like to avoid hardcoding the definition of the "golden time" period. There's also the potential for 18 or 24 hour shifts so there may be multiple passes through the "golden time" period. I realize this may be more of a math problem than an Excel problem, but any help would be appreciated. Thanks!