+ Reply to Thread
Results 1 to 5 of 5

Calculate hours during set times for night shift allowance

  1. #1
    Registered User
    Join Date
    08-29-2017
    Location
    Earth
    MS-Off Ver
    2010
    Posts
    4

    Calculate hours during set times for night shift allowance

    Hi Everyone,


    I'm trying to calculate the number of hours worked between two set times (20:00 - 08:00).

    The shifts go overnight so I need a formula to know when that happens. Also, the start and finish time can be before 20:00 and finish after 08:00.

    I have attached a simple excel sheet which has the correct hours manually entered. The cells highlighted green was the one I has having issues with the following formula (not my work).

    =IF(B2<C2,MAX(MIN("24:00:00",C2)-MAX("20:00:00",B2),0)+MAX(MIN("8:00:00",C2)-MAX("0:00:00",B2),0),MAX(MIN("30:00:00",C2+1)-MAX("20:00:00",B2),0)+MAX(("8:00:00"-B2),0))*24

    I'm hoping you can help me.


    Thanks,
    mbeire
    Attached Files Attached Files

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Calculate hours during set times for night shift allowance

    Hi mbeire, welcome to the forum. Paste this in D2 and copy down:
    Please Login or Register  to view this content.
    Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee

  3. #3
    Registered User
    Join Date
    08-29-2017
    Location
    Earth
    MS-Off Ver
    2010
    Posts
    4

    Re: Calculate hours during set times for night shift allowance

    Hi Leelnich,

    That formula is exactly what I needed. Thanks for the extremely quick response.

    I have marked the thread solved and provided rep to leelnich.

    Thanks

  4. #4
    Registered User
    Join Date
    08-29-2017
    Location
    Earth
    MS-Off Ver
    2010
    Posts
    4

    Re: Calculate hours during set times for night shift allowance

    Quote Originally Posted by leelnich View Post
    Hi mbeire, welcome to the forum. Paste this in D2 and copy down:
    Please Login or Register  to view this content.
    Hi Leelnich,

    That formula is exactly what I needed. Thanks for the extremely quick response.

    I have marked the thread solved and provided rep to leelnich.

    Thanks

  5. #5
    Registered User
    Join Date
    08-29-2017
    Location
    Earth
    MS-Off Ver
    2010
    Posts
    4

    Re: Calculate hours during set times for night shift allowance

    Quote Originally Posted by leelnich View Post
    Hi mbeire, welcome to the forum. Paste this in D2 and copy down:
    Please Login or Register  to view this content.
    Hi leelnich,

    Thanks again for the formula. I notice the formula only return whole numbers. It will not count 1/4 or 1/2 hours as some shifts can be start different hours (15,30,45 mins). Can the current formula be adapted?

+ 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 calculate night shift hours?
    By jane_dm7 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-04-2023, 09:52 AM
  2. [Solved] Night shift allowance (2200-0600) start and finnish time vary
    By grunternic in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-03-2015, 05:49 AM
  3. Excel how to calculate number of night shift hours?
    By testeret in forum Excel General
    Replies: 2
    Last Post: 07-15-2013, 11:42 AM
  4. Sum night allowance hours for whole month
    By Teflon in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-11-2012, 02:17 AM
  5. Replies: 4
    Last Post: 09-21-2012, 12:58 AM
  6. [SOLVED] Calculation of Night Allowance between specific hours using excel
    By Womble2011 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-04-2012, 03:49 AM
  7. [SOLVED] Need to calculate night shift hours
    By avdald in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-23-2012, 02:25 PM

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