+ Reply to Thread
Results 1 to 9 of 9

Calculate total hours that fall between a specific time period (Over midnight)

  1. #1
    Registered User
    Join Date
    10-17-2019
    Location
    Stockholm
    MS-Off Ver
    365 ProPlus
    Posts
    70

    Calculate total hours that fall between a specific time period (Over midnight)

    Hi All, I am new in this wonderful forum.

    Hope my question will be clear.

    Need to know the specific time that fall between 22.00 and 6.00 a.m. when the time in (of an operator) and the time out can be at any time.

    Basically, in my sheet the formula in cell D6 need to be fixed.

    Some cases are ok with what I did but this last donīt work.

    Please help me wonderful people
    Attached Files Attached Files
    Last edited by nik_re; 04-19-2020 at 05:58 AM.

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Calculate total hours that fall between a specific time period (Over midnight)

    can you post a sample file , see how yellow banner
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    10-17-2019
    Location
    Stockholm
    MS-Off Ver
    365 ProPlus
    Posts
    70

    Re: Calculate total hours that fall between a specific time period (Over midnight)

    Quote Originally Posted by etaf View Post
    can you post a sample file , see how yellow banner
    Sorry... first time.. .I did not upload it. Now it should be attached.

    Thank you for your patience

  4. #4
    Registered User
    Join Date
    01-24-2020
    Location
    Belgium
    MS-Off Ver
    2013
    Posts
    95

    Re: Calculate total hours that fall between a specific time period (Over midnight)

    Your formulae in the mockup is all Greek to me

    Let's cut it through. As Excel deals with time as decimal ranging from 0.0 (00:00:00) to 0.999988425925926 (23:59:59), arithmetic subtraction applies. As to overnight, plus 1 to the ending time is enought, eg A1=23:15:00, A2=6:20:00
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Generally speaking, Excel is intelligent enough to convert the result to "Time" format. You may use such a formula just in case,
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-17-2019
    Location
    Stockholm
    MS-Off Ver
    365 ProPlus
    Posts
    70

    Re: Calculate total hours that fall between a specific time period (Over midnight)

    Hi,

    I have tried to do it better, there are two types of formula that I am using as you can see in the document.
    The second one work for everything except where the cell is highlighted.

    ThxAlot, I am not understanding in which cell I should write the formula that you said.

    Thank you for all these replies.

    Trying to do better and better..
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    10-17-2019
    Location
    Stockholm
    MS-Off Ver
    365 ProPlus
    Posts
    70

    Re: Calculate total hours that fall between a specific time period (Over midnight)

    Quote Originally Posted by ThxAlot View Post
    Your formulae in the mockup is all Greek to me

    Let's cut it through. As Excel deals with time as decimal ranging from 0.0 (00:00:00) to 0.999988425925926 (23:59:59), arithmetic subtraction applies. As to overnight, plus 1 to the ending time is enought, eg A1=23:15:00, A2=6:20:00
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Generally speaking, Excel is intelligent enough to convert the result to "Time" format. You may use such a formula just in case,
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    the problem is taht if the operator 1 will access the office at 21 and left at 5, then when the formula will do the check with the upper(06) and lower(22) limit, will not understand the time that fall between 22 and 6. I donīt know how to fix it, while it works if lower and upper are sorted (0... 23)

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

    Re: Calculate total hours that fall between a specific time period (Over midnight)

    Hi what are the actual shift times that staff work

    i.e. 22:00 - 6:00
    06:00 - 14:00
    14:00 - 22:00

    If you base your upper and lower times on a 48hr clock, so 6:00am the next day would be entered as 30:00 etc and format the cells as h:mm am/pm it would be displayed as 6:00am and in the formula bar as 01/01/1900 06:00:00 or you can display it as 30:00 formatting it to [h]:mm

    use the following formula

    Please Login or Register  to view this content.
    this is one of Daddylonglegs formulas
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    10-17-2019
    Location
    Stockholm
    MS-Off Ver
    365 ProPlus
    Posts
    70

    Re: Calculate total hours that fall between a specific time period (Over midnight)

    Hi Toniees,

    thank you. I am using the date and time to fix the issue (basically is what you suggested)

    this is just the beginning of a project.

    the time shift is 9.00 to 17.00

    I will have to distinguish the hours that operator will work in weekdays and weekend too.

    I am going to open a new thread, in the meanwhile thank you for your answer. Appreciated.

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

    Re: Calculate total hours that fall between a specific time period (Over midnight)

    you can also check this thread out and have a look at BlindAlley post and attachment called "Shift Hours"

    https://www.excelforum.com/excel-for...e-formula.html


    https://www.excelforum.com/attachmen...ift-hours.xlsx

+ 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] Formula Needed - Calculate total hours that fall between a specific time period.
    By JennyGP in forum Excel - New Users/Basics
    Replies: 8
    Last Post: 04-19-2020, 02:44 AM
  2. Calculate how many hours fall between a set date and time range
    By elleb in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-14-2018, 03:55 PM
  3. [SOLVED] Formula to calculate: # of hours in a timespan that fall between Midnight and 6AM
    By Deicidium in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 07-23-2015, 05:05 PM
  4. Figuring total hours in military time going passed midnight.
    By kradecki in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-17-2014, 09:47 AM
  5. Replies: 13
    Last Post: 11-04-2013, 02:30 AM
  6. Replies: 9
    Last Post: 07-26-2012, 10:01 PM
  7. [SOLVED] Figuring total hours in military time going passed midnight.
    By NETSPY in forum Excel General
    Replies: 9
    Last Post: 07-09-2012, 05:59 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