I need help to create an Excel formula to see how many overnight hours have been worked during a particular period for billing purposes. Our employees’ clock in and out at various times and I need to exclude the time outside of the hours of 11pm to 6am. We pay our employees for all the time they work but we can only bill our customer for time worked between 11pm and 6am the next day. Below is an example of several time punch scenarios to calculate how much we can bill to our customer. I’ve tried several IF, MOD and TIMEVALUE formulas but nothing seems to work due to the extra complexity of calculating time over two day period. For instance, the perfect scenario is in row 2 where employee clocked in at 11pm and clocked out at 6am. 7 hours is billed to the customer.
In row 3, the employee clocked in 5 minutes early and clocked out 10 minutes later. We will pay the employee 7 hours and 15 minutes but only bill the customer 7 hours.
Row 4 would be billed at 30 minutes and so on. Row 11 we would not bill the customer for any hours due to the entire time being outside of the 11pm to 6am window.
I know these examples are somewhat simplistic in their clock in/clock out nature. I would prefer to stay away from VBA as I don’t understand it and have no experience with it. Any suggestions on formulas I can use to cover all of these scenarios? Total time worked and time only between 11pm and 6am?
Thank you
In row 3, the employee clocked in 5 minutes early and clocked out 10 minutes later. We will pay the employee 7 hours and 15 minutes but only bill the customer 7 hours.
Row 4 would be billed at 30 minutes and so on. Row 11 we would not bill the customer for any hours due to the entire time being outside of the 11pm to 6am window.
I know these examples are somewhat simplistic in their clock in/clock out nature. I would prefer to stay away from VBA as I don’t understand it and have no experience with it. Any suggestions on formulas I can use to cover all of these scenarios? Total time worked and time only between 11pm and 6am?
Thank you