+ Reply to Thread
Results 1 to 7 of 7

Counting hours worked in a range.

  1. #1
    Registered User
    Join Date
    06-07-2008
    Posts
    3

    Counting hours worked in a range.

    I have created a timesheet to count the number of hours one works in a day. Now I need the timesheet to be able to calculate the number of hours one works between 16:00 and 08:00 the next day.

    The start and end times are at all hours of the day, so the timesheet has to be able to calculate between any two times, and not just times within the same day.

    How can I achieve this? I only need to work with two values: the start time in cell B10 and the end time in cell B13.

    Thanks
    Last edited by Pittman; 06-09-2008 at 10:38 AM.

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    Does this link help?

    http://www.cpearson.com/excel/overtime.htm
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Registered User
    Join Date
    06-07-2008
    Posts
    3
    Unfortunately, that page does not have any info which I need. I only need to be able to count the number of hours worked between 16:00 to 08:00 from any shift.

    The overtime section of my sheet is already completed (Minus an adaptation of the formula which I am currently looking for).

  4. #4
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    See this link and look for TIME intervals

    http://www.cpearson.com/excel/datearith.htm

  5. #5
    Registered User
    Join Date
    06-07-2008
    Posts
    3
    I don't understand how calculating the difference between two times will help me solve the problem at hand.

    I have already solved this part of the problem, and can calculate the total amount of hours worked in one shift. I want to be able to find out how many hours worked in a shift fall between 16:00 and 08:00 based on the start and end times.

    For example:
    1) If you sign in at 04:00 and leave at 12:00, the answer will be 4.00 (4am - 8am = 4 hours).
    2) If you sign in at 21:00 and out at 05:00, the answer will be 8.00 (all hours are after 16:00, and before 08:00, therefore 21:00 - 05:00 = 8 hours).

    Am I looking at time intervals the wrong way?

  6. #6
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    Here's one way of calculating it, does it help?

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    What's the longest shift you have? This might be overkill but will cope with shifts up to 24 hours long, start time in B10, end time in B13

    =MOD(B13-B10,1)-(B10>B13)*MEDIAN(0,B13-1/3,2/3)-MAX(0,MIN(1/3,B13+(B10>B13))-MAX(1/3,B10))

    format as [h]:mm

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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