+ Reply to Thread
Results 1 to 5 of 5

Night Time Differential - MOD Function

  1. #1
    Registered User
    Join Date
    11-20-2020
    Location
    Cyprus
    MS-Off Ver
    365
    Posts
    3

    Night Time Differential - MOD Function

    I've used this formula to determine hours worked between 22:00-06:00 and it works fine:
    =MOD($S4-$R4,1)*24-($S4<$R4)*(22-6)-MEDIAN($S4*24,22,6)+MEDIAN($R4*24,22,6)

    I'm now trying to calculate hours worked between 00:00 - 06:00, but it doesn't give me the correct value:
    =MOD($S4-$R4,1)*24-($S4<$R4)*(0-6)-MEDIAN($S4*24,0,6)+MEDIAN($R4*24,0,6)

    Also I have another column with the day of the week (column q). I want to show the hours worked on a Sunday only. What formula can be used for this?


    Can you please help?

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Night Time Differential - MOD Function

    Hi there.

    A picture is worth 1,000 words. An Excel sheet is worth 1,000 pictures.

    Please read the yellow banner about sample worksheets, at the top of the screen. Act on its guidelines and post a SMALL sample sheet.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    11-20-2020
    Location
    Cyprus
    MS-Off Ver
    365
    Posts
    3

    Re: Night Time Differential - MOD Function

    Please see attached sample workbook
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Night Time Differential - MOD Function

    for this instance, if no shifts start between midnight and 6 in the morning
    =IF(INT(C3)>INT(B3),MIN(0.25,F3),0)*24

  5. #5
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Night Time Differential - MOD Function

    For sundays perhaps
    =IF(WEEKDAY(B3)=1,MIN(C3,INT(B3)+1)-B3,0)*24+IF(WEEKDAY(C3)=1,C3-MAX(B3,INT(C3)),0)*24

+ 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] How to count hours for Night Differential (using IF function)
    By helpme10 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-30-2019, 05:07 PM
  2. Night Differential
    By jacknhell in forum Excel General
    Replies: 4
    Last Post: 03-14-2018, 03:13 AM
  3. [SOLVED] Night differential
    By remyte in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-04-2016, 04:23 PM
  4. [SOLVED] Night Shift Differential
    By vaium in forum Excel General
    Replies: 9
    Last Post: 04-15-2016, 11:05 AM
  5. TIME DIFFERENCE - Calculate Night Differential
    By persnickety in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-12-2013, 12:44 PM
  6. How to calculate Night Differential
    By mar_t in forum Excel General
    Replies: 10
    Last Post: 01-04-2013, 01:55 AM
  7. Replies: 2
    Last Post: 07-27-2012, 04:54 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