+ Reply to Thread
Results 1 to 9 of 9

Calculate hours worked per day where we have multiple shifts per day and shifts span 12pm

  1. #1
    Registered User
    Join Date
    03-16-2012
    Location
    MN
    MS-Off Ver
    Excel 2010
    Posts
    50

    Calculate hours worked per day where we have multiple shifts per day and shifts span 12pm

    I am trying to calculate hours worked per day. The problem that has me stumped is how to handle multiple shifts per day and times that span midnight. I understand that Excel might not be (perhaps there is no might about it, it's not) the best tool for the job, but if there is a brilliant way to crack this I am sure one of you can supply what I need. I also understand that this question is probably asked and answered, but it is hard to search for and I have not found an answer.

    Thanks!


    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Calculate hours worked per day where we have multiple shifts per day and shifts span 1

    Are you looking for the Total for User U03? or the Total per row or the total per day?
    If it's total per day, when they work across midnight, do you put the entire amount into the first date or split it at midnight?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Calculate hours worked per day where we have multiple shifts per day and shifts span 1

    Try one of these...

    For a result in Time format:

    =MOD(time out-time in,1)

    Format as h:mm

    For a result in decimal format:

    =MOD(time out-time in,1)*24

    Format as General or Number
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Calculate hours worked per day where we have multiple shifts per day and shifts span 1

    I don't think you need anything too tricky, just format your cells properly. The time in/out cells should be formatted as m/d/yyyy h:mm (under 'Custom'), while the subtraction row to find the hours should be formatted as h:mm (also under custom. Then just use subtraction: =C2-B2 to get the hours worked each shift.

  5. #5
    Registered User
    Join Date
    03-16-2012
    Location
    MN
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Calculate hours worked per day where we have multiple shifts per day and shifts span 1

    Quote Originally Posted by ChemistB View Post
    Are you looking for the Total for User U03? or the Total per row or the total per day?
    If it's total per day, when they work across midnight, do you put the entire amount into the first date or split it at midnight?
    I am looking for the total worked per day. So:
    Please Login or Register  to view this content.
    (I did these calcs manually so I am hoping I got them right)

  6. #6
    Registered User
    Join Date
    03-16-2012
    Location
    MN
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Calculate hours worked per day where we have multiple shifts per day and shifts span 1

    Quote Originally Posted by cantosh View Post
    I don't think you need anything too tricky, just format your cells properly. The time in/out cells should be formatted as m/d/yyyy h:mm (under 'Custom'), while the subtraction row to find the hours should be formatted as h:mm (also under custom. Then just use subtraction: =C2-B2 to get the hours worked each shift.
    Hours worked per shift gets part of the way there, but I need to split the time between two days if a shift spans a day.

  7. #7
    Forum Contributor Toonies's Avatar
    Join Date
    07-30-2009
    Location
    Newcastle, UK
    MS-Off Ver
    Excel 2016
    Posts
    503

    Re: Calculate hours worked per day where we have multiple shifts per day and shifts span 1

    Deleted

    I should have looked at post #1 D'oh
    Last edited by Toonies; 03-24-2016 at 06:06 PM.

  8. #8
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: Calculate hours worked per day where we have multiple shifts per day and shifts span 1

    DayWorked: G2:G4
    try this...
    =SUM(IF(INT($B$2:$B$5)=G2,IF($C$2:$C$5<G2+1,$C$2:$C$5,G2+1)-$B$2:$B$5,IF(INT($C$2:$C$5)=G2,MOD($C$2:$C$5,1),0)))
    Enter with Ctrl+Shift+Enter
    Copy down
    Attached Files Attached Files

  9. #9
    Forum Contributor Toonies's Avatar
    Join Date
    07-30-2009
    Location
    Newcastle, UK
    MS-Off Ver
    Excel 2016
    Posts
    503

    Re: Calculate hours worked per day where we have multiple shifts per day and shifts span 1

    Deleted did not work
    Last edited by Toonies; 03-24-2016 at 08:35 PM.

+ 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. Hours worked on Different Shifts - Breakdown on overtime and ordinary
    By Rangedale in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-22-2015, 12:50 AM
  2. Rota with 4 shifts - calculate hours?
    By graboid in forum Excel General
    Replies: 3
    Last Post: 11-01-2014, 03:40 PM
  3. Calculate Several Sub Shifts Hours
    By ioncila in forum Excel General
    Replies: 2
    Last Post: 04-01-2014, 11:00 AM
  4. Replies: 9
    Last Post: 07-26-2012, 10:01 PM
  5. Replies: 1
    Last Post: 01-02-2012, 02:47 PM
  6. Dividing a time span into shifts - overlapping days
    By Heidi in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 02-27-2006, 10:14 PM
  7. [SOLVED] A function that separates hours worked in work shifts that overlap
    By Katybug1964 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-24-2005, 05:06 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