Our employees work many different shifts. Whatever shift they work, they get night premium for those hours that fall between 6PM and 6AM the next morning. Some shifts start and end before midnight, and other shifts start before midnight and go until after midnight, and some start before midnight and go until after 6AM, and others start at midnight and go until after 6AM. Below is an attachment showing some example shifts. I need a formula that will calculate the number of hours in the shift that fall between 18:00 and 06:00. If possible, I need the same formula to be used whether or not the shift crosses midnight. Thanks in advance for any help.
Test.xlsx
Bookmarks