+ Reply to Thread
Results 1 to 8 of 8

returning values based on time frame

  1. #1
    Registered User
    Join Date
    01-08-2018
    Location
    Minneapolis, MN
    MS-Off Ver
    Office 365
    Posts
    13

    returning values based on time frame

    Good afternoon,

    I am currently working on building an employee hours template, but am getting stuck with getting the data to pull through correctly.

    The problem:
    Getting an employee hours to be broken out by day-part. How many hours is an employee working/available per the morning (open to 11am)/day(11am - 3pm)/evening (3pm to close). With Weekends being calculated independently.

    Currently I have the spreadsheet (sheet 1320 Original) broken out by day and day-part. Then calculating how many hours a given employee is scheduled (columns AU - AX) and then finally being calculated on (columns AZ - BC). But I am looking to simplify/slimming the spreadsheet (sheet 1320 - WIP) so that each day of the week has a start and end time.

    Is it possible in Excel to do an if/sum statement based on a time-frame, and then be able to calculate how many hours are scheduled for a given day-part? So if someone is scheduled between 2pm and 6pm. One hour would populate in the Day column Y and 3 hours would populate under the Evenings column Z.

    Another inquirer is to see if it's possible to have a cap set at a predetermined number (40 hours) and flag the user if they are over for a given employee?

    I apologize if this has been solved previously. Everything i have researched and tried has not worked out how I through it would.

    Thank you
    James Hammock
    Attached Files Attached Files
    Last edited by AliGW; 10-02-2019 at 05:18 PM. Reason: Solved tag correctly applied and title edited accordingly.

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,594

    Re: returning values based on time frame

    Is the attached file the same as the one that you posted in the Timesheet Issues thread?
    If not, and if you wish to continue with this thread, please attach that file to this thread and tell us specifically what you need help with.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Registered User
    Join Date
    01-08-2018
    Location
    Minneapolis, MN
    MS-Off Ver
    Office 365
    Posts
    13

    Re: returning values based on time frame

    Hi JeteMc,

    It is the same one as in the Timesheet Issue thread. But I removed that post to comply with the the forum rules. Thank you for the reply.

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,594

    Re: returning values based on time frame

    My suggestion would be to use the 1320 Original sheet as the computational engine with the 1320 WIP sheet used for input and output/display.
    I only filled in the Wednesday and Morning sections of the 1320 Original sheet. Apply the same formulas to the other days/times of day (changing the reference cells of course).
    1. The Mornings Start column uses: =IF(AND(' 1320 - WIP'!$E4<>"",' 1320 - WIP'!$E4<F$1),' 1320 - WIP'!$E4,"")
    2. The Mornings End column uses: =IF(E5="","",IF(' 1320 - WIP'!$F4>F$1,F$1,' 1320 - WIP'!$F4))
    3. The Days Start column uses: =IF(AND(' 1320 - WIP'!$E4<>"",' 1320 - WIP'!$E4<H$1,' 1320 - WIP'!$E4>=F$1),' 1320 - WIP'!$E4,IF(AND(E5<>"",' 1320 - WIP'!$F4<>"",' 1320 - WIP'!$F4>F$1),F$1,""))
    4. The Days End column uses: =IF(G5="","",IF(' 1320 - WIP'!$F4>H$1,H$1,' 1320 - WIP'!$F4))
    5. The Evenings Start column uses: =IF(AND(' 1320 - WIP'!$E4<>"",' 1320 - WIP'!$E4>=H$1),' 1320 - WIP'!$E4,IF(AND(G5<>"",' 1320 - WIP'!$F4<>"",' 1320 - WIP'!$F4>H$1),H$1,""))
    6. The Evenings End column uses: =IF(I5="","",' 1320 - WIP'!$F4)
    Note that cell F1 contains the value 11:00 AM and cell H1 contains the value 3:00 PM
    On the 1320 Origin sheet the Mornings column uses: =IF(E5="",0,F5-E5)+IF(K5="",0,L5-K5)+IF(Q5="",0,R5-Q5)+IF(AI5="",0,AJ5-AI5)+IF(AO5="",0,AP5-AO5)
    On the 1320 WIP sheet the Mornings column (S) uses: ='1320 Original'!AU5
    I will leave the Thursday:Tuesday sections as well as Days and Evenings in your capable hands.
    Let us know if you have any questions.
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: returning values based on time frame

    (Sorry about my English)

    I've apply formula in range S1:V2 and S4:V6 ( include change number format )
    I hope it's OK.

    Regards.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-08-2018
    Location
    Minneapolis, MN
    MS-Off Ver
    Office 365
    Posts
    13

    Re: returning values based on time frame

    JeteMc and Menem thank you so much for both of these options. I will use both to see what works best for my application. But this gets me to where I needed to be.

  7. #7
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,594

    Re: [SOLVED] returning values based on time frame

    Have a feeling the menem's solution is going to work best, simpler and doesn't require the use of the 1320 - Original sheet. (I wish I had thought of it myself to be honest).
    @menem. Nice formula solution. In the future it would be helpful to others whom may be looking for similar solutions, if you would include the formulas in the post.
    I hope you both have a blessed day.

  8. #8
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: returning values based on time frame

    (Sorry about my English).

    JeteMc, I'll try my best (with my poor English) >_<".

    Concept of calculation is base on 2 type of data,
    1:WorkDay
    2:Holiday

    WorkDay have 3 time interval [ >0.00-11:00 , >11:00-15:00 , >15:00-EndOfDay ]
    So I use cells to store these time for begin (row1) and ending (row2) in column
    S, T and U as for WorkDay

    Then use formula that refered from workday (Mon/Tue/Wed/Thu/Fri)
    by use start/stop time compare to begin/ending time of each interval.

    S4
    =IF(AND($E4<=S$2,$F4>=S$1),IF($F4>S$2,S$2,$F4)-IF($E4<S$1,S$1,$E4),0)
    +IF(AND($G4<=S$2,$H4>=S$1),IF($H4>S$2,S$2,$H4)-IF($G4<S$1,S$1,$G4),0)
    +IF(AND($I4<=S$2,$J4>=S$1),IF($J4>S$2,S$2,$J4)-IF($I4<S$1,S$1,$I4),0)
    +IF(AND($O4<=S$2,$P4>=S$1),IF($P4>S$2,S$2,$P4)-IF($O4<S$1,S$1,$O4),0)
    +IF(AND($Q4<=S$2,$R4>=S$1),IF($R4>S$2,S$2,$R4)-IF($Q4<S$1,S$1,$Q4),0)


    Weekday is more easier because it have only 1 interval.
    And again refered from weekday (Sat/Sun)

    V4
    =IF(AND($K4<=V$2,$L4>=V$1),IF($L4>V$2,V$2,$L4)-IF($K4<V$1,V$1,$K4),0)
    +IF(AND($M4<=V$2,$N4>=V$1),IF($N4>V$2,V$2,$N4)-IF($M4<V$1,V$1,$M4),0)

    All value are in Excel standard time format (1=1 Day) so, it can be calculate
    as a normal number with others formula (column X to AA)

    Regards.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Converting Time Frame based on Cell Values
    By reyrey in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-06-2013, 10:14 PM
  2. [SOLVED] Speadsheet help - identifying returning clients within a time frame
    By vin1602 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-09-2013, 09:47 AM
  3. Replies: 1
    Last Post: 12-27-2012, 02:43 PM
  4. Creating a Formula based on time frame in a drop down box
    By Caileanbw in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-26-2012, 02:18 AM
  5. Loan Calculator with Terms based on Fixed Payment not a fixed time frame.
    By cc4digital in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-03-2012, 04:49 AM
  6. Excel 2007 : Adds values for a specific time frame
    By Raist23 in forum Excel General
    Replies: 3
    Last Post: 03-15-2012, 05:43 AM
  7. spreading values across a time frame
    By REDeveloper in forum Excel General
    Replies: 6
    Last Post: 10-20-2009, 11:55 AM

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