Closed Thread
Results 1 to 2 of 2

Calculate Hours Falling Within Defined Windows of Time

  1. #1
    Registered User
    Join Date
    05-26-2010
    Location
    Ballston Lake, NY
    MS-Off Ver
    Microsoft Office 365 Business
    Posts
    9

    Calculate Hours Falling Within Defined Windows of Time

    I'm working on creating a scheduling tool for Front Desk employees at a hotel. I have rows for up to 20 different employees (Rows 13-32) with employee names in Column B, Shift Start Times for Tuesday (first day of their work week) formatted as Time (i.e., 7:00 AM) in Column C, Shift End Times for Tuesday formatted as Time (i.e., 3:00 PM) in Column D, and a formula calculating each employees number of hours for that day in Column E.

    The hotel has three different "Shifts": the "AM Shift" starts at 7:00 AM and runs until 3:00 PM, the "PM Shift" starts at 3:00 PM and runs until 11:00 PM, and the "ON Shift" (overnight) starts at 11:00 PM and runs until 7:00 AM the following day. Employees scheduled hours may mirror the predefined shifts (i.e., an employee may be scheduled to work the AM Shift from 7AM-3PM), or they may be scheduled for hours that fall within two or more predefined shifts (i.e., an employee may be scheduled to work from 12PM-8PM which would be 3 hours in the AM Shift and 5 hours in the PM Shift). For each employee, I need to calculate the number of hours they're scheduled for in the AM Shift, PM Shift, and ON Shift windows so I can then sum them for all employees and arrive at the total AM Shift hours, PM Shift hours, and ON Shift hours scheduled for each day. I've created helper columns to the right and I've been able to figure this out for the AM Shift and PM Shift hours in the attached file, however calculating the ON Shift hours for each employee is proving to be extremely troublesome due to the fact that this shift spans two days. The formula needs to be able to handle blank cells (return 0 for these) and should correctly handle all scenarios including (but not limited to) the following:

    • Shift Start Time of 7:00 AM and Shift End Time of 3:00 PM should return 0.
    • Shift Start Time of 11:00 PM and Shift End Time of 7:00 AM should return 8.
    • Shift Start Time of 10:00 PM and Shift End Time of 9:00 AM should return 8.
    • Shift Start Time of 12:00 AM and Shift End Time of 7:00 AM should return 7.
    • Shift Start Time of 5:00 PM and Shift End Time of 1:00 AM should return 2.


    If someone could please provide a formula I can use in cells AD13:AD32 of the attached workbook, I would be eternally grateful as I've been pulling my hair out for two full days now trying to come up with a solution! Thanks in advance for any assistance you can provide - Robert
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,754

    Re: Calculate Hours Falling Within Defined Windows of Time

    Administrative Note:

    Welcome to the forum.

    Unfortunately, this is a duplicate thread, and you are allowed only ONE thread per issue here.

    Please see Forum Rule #2 about thread duplication.

    I am closing this thread, but you may continue here in the original thread: https://www.excelforum.com/commercia...s-of-time.html

    Thread closed.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 09-09-2022, 10:07 AM
  2. [SOLVED] Difference in Hours and Minutes between two time windows
    By KatieA in forum Excel General
    Replies: 10
    Last Post: 12-06-2021, 10:43 AM
  3. Calculate hours falling inside a time interval
    By Davidi81 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-11-2021, 10:03 AM
  4. [SOLVED] Formula to Calculate Normal Hours, Time & 1/2 & Double Time from Daily Hours per week
    By KazzICC in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-17-2014, 01:51 AM
  5. [SOLVED] Calculate time for working hours when start time falls outside of working hours
    By SKDY_Beau in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-20-2014, 12:50 PM
  6. Subtracting hours from time to calculate overtime hours
    By nabilishes in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 10-16-2012, 08:56 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1