+ Reply to Thread
Results 1 to 6 of 6

Number of hours between specific times Monday to Friday with exclusions- Timesheet

  1. #1
    Registered User
    Join Date
    12-02-2019
    Location
    Melbourne Australia
    MS-Off Ver
    365
    Posts
    4

    Number of hours between specific times Monday to Friday with exclusions- Timesheet

    Hi all,

    I have been browsing this forum and haven't been able to find a previously solved solution to this specific problem (apologies if has been done.. couldn't find it!!).

    I am essentially trying to set up a spreadsheet that will interpret a pay award correctly. I am having a bit of difficulty working with days/dates & times.

    I need to calculate the number of rostered hours between 10pm to midnight, and midnight to 6am Monday to Friday on normal hours only (the first 12 hours of shift excluding breaks, overtime & public holidays) ie: if working after midnight on a Friday, Sat rates are paid INSTEAD of unsociable hours allowance.

    Unsociable hours allowance are to be paid:
    - On normal hours Monday to Friday (Column H - 1st 12 hours of shift, not overtime or pub hol)
    Between 10pm - Midnight &
    Between Midnight - 6am
    They are paid at different rates hence needing the hours separate.

    Are NOT to be paid
    - On breaks
    - Sat or Sun
    - On overtime (O/T)
    - On Public holidays

    Ideally the formula will reference these times from a cell so they can be changed for a different award (R5:S6)
    I'm thinking we may need a helper column - a column that has a formula that returns the time range the first 12 hours fall into??? Which falls well outside of my capability!


    Please attached example spreadsheet - I have put the answers required in the pink cells (K15:L19)

    Thankyou for your help in advance

    Christine
    Attached Files Attached Files
    Last edited by cj0044; 12-16-2019 at 06:27 PM.

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Number of hours between specific times Monday to Friday with exclusions- Timesheet

    Please try at
    K15
    =(WEEKDAY(A15,2)<6)*24*(MAX(0,MIN($S$5+($R$5>$S$5),MIN(MOD(C15-B15,1),1/2)+B15)-$R$5)+MAX(0,MIN(MIN($S$5+($R$5>$S$5),E15+MIN(MOD(F15-E15,1),1/2-MOD(C15-B15,1))))-$R$5

    L15
    =(WEEKDAY(A15,2)<6)*24*(MAX(0,MIN($S$6+($R$5>$S$5),MIN(MOD(C15-B15,1),1/2)+B15)-($R$6+($R$5>$S$5)))+MAX(0,MIN($S$6+($R$5>$S$5),E15+MIN(MOD(F15-E15,1),1/2-MOD(C15-B15,1)))-($R$6+($R$5>$S$5))))

    K19 On 20-sep first 12 hours end at 9:40pm No hour fall in 10pm-12am
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    12-02-2019
    Location
    Melbourne Australia
    MS-Off Ver
    365
    Posts
    4

    Re: Number of hours between specific times Monday to Friday with exclusions- Timesheet

    You are a genius thankyou!!!! Very very much.. my brain almost exploded trying to figure this out.

  4. #4
    Registered User
    Join Date
    12-02-2019
    Location
    Melbourne Australia
    MS-Off Ver
    365
    Posts
    4

    Re: Number of hours between specific times Monday to Friday with exclusions- Timesheet

    Hi Bo_Ry.

    Unfortunately the above formula is not working when the unsociable hours fall on a Monday morning at the end of a Sunday shift. I have highlighted on the attached sheet. Any ideas would be much appreciated.

    Thanks,
    Christine
    Attached Files Attached Files

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

    Re: Number of hours between specific times Monday to Friday with exclusions- Timesheet

    Bo_Ry's formulas yield the same values that are manually placed in K15:L15 (1 and 0).
    There is a difference between what the formula in K19 yields (0) and what is manually placed there (1.75). It may help if we could have an explanation of why 1.75 is expected.
    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.

  6. #6
    Registered User
    Join Date
    12-02-2019
    Location
    Melbourne Australia
    MS-Off Ver
    365
    Posts
    4

    Re: Number of hours between specific times Monday to Friday with exclusions- Timesheet

    Hi JeteMc,

    I had the incorrect value in K9, which Bo_Ry had corrected. I have now just deleted Bo_Ry's forumula from the 10-mid cell on the Sunday, and removed the weekday reference for the Mid - 6am cell. So have it working now thanks!!!!

    Will mark as solved. Thankyou for helping.

    Thanks,
    Christine

+ 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. Calculate hours worked between fixed dates on Monday through Friday.. [Newbie]
    By Richard Bakker in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-07-2019, 11:09 AM
  2. [SOLVED] Timesheet total for hours worked between specific times of day e.g. 10pm to 12am
    By thisfatcat in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-05-2017, 01:13 AM
  3. Timesheet number of hours
    By snottus in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-29-2014, 04:34 AM
  4. Timesheet: Calculate hours between times
    By roulette in forum Excel General
    Replies: 4
    Last Post: 05-04-2010, 05:42 PM
  5. Number of Monday - Friday weeks
    By charl in forum Excel General
    Replies: 2
    Last Post: 01-31-2008, 08:59 AM
  6. Monday to Friday
    By lunar_star in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-09-2007, 12:22 AM
  7. [SOLVED] Help change Friday to following Monday
    By David in forum Excel General
    Replies: 4
    Last Post: 06-21-2006, 08:30 PM

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