+ Reply to Thread
Results 1 to 13 of 13

How to calculate time range from 22:00 - 6:00

  1. #1
    Registered User
    Join Date
    02-06-2012
    Location
    Las pinas, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    5

    How to calculate time range from 22:00 - 6:00

    hi guys,

    I've been trying to figure how to compute the time for a certain time range.

    ex.
    time in time out Start Premium End Premium Hours in Premium
    20:06 9:35 22:00 6:00 ????
    1:00 21:00 22:00 6:00

    I need to calculate how many time they work for start premium to end premium. Please see my example.

    Just to not that this is 24 hours work shift and there are different time scenario which makes it more difficult for me.

    thanks in advance
    Attached Files Attached Files
    Last edited by kurk011; 02-06-2012 at 05:48 PM.

  2. #2
    Registered User
    Join Date
    02-06-2012
    Location
    Las pinas, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: How to calculate time range from 22:00 - 6:00

    I think the time mess up on the example.. you could check the attachment to understand more the problem i have

  3. #3
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: How to calculate time range from 22:00 - 6:00

    Try

    =MOD(D2-C2,1)

  4. #4
    Registered User
    Join Date
    02-06-2012
    Location
    Las pinas, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: How to calculate time range from 22:00 - 6:00

    thanks for the reply but it doesnt give the value i want. i need to compute the hours he worked within that range (22:00 - 6:00).

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,806

    Re: How to calculate time range from 22:00 - 6:00

    Try this formula in E2

    =MOD(B2-A2,1)-(B2<A2)*(C2-D2)-MEDIAN(B2,C2,D2)+MEDIAN(A2,C2,D2)

    assumes that C2 to D2 will always cross midnight
    Audere est facere

  6. #6
    Registered User
    Join Date
    02-06-2012
    Location
    Las pinas, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    5

    Thumbs up Re: How to calculate time range from 22:00 - 6:00

    Quote Originally Posted by daddylonglegs View Post
    Try this formula in E2

    =MOD(B2-A2,1)-(B2<A2)*(C2-D2)-MEDIAN(B2,C2,D2)+MEDIAN(A2,C2,D2)

    assumes that C2 to D2 will always cross midnight
    thanks... got it.

  7. #7
    Registered User
    Join Date
    02-10-2012
    Location
    ireland
    MS-Off Ver
    Excel 2002
    Posts
    8

    Re: How to calculate time range from 22:00 - 6:00

    Hi Guys wondering if you could help me

    i need to create a time sheet where by hours from 7 am to 18:00(6pm) get placed in one area and then hours after this get placed in another area to work out how many hours worked on on morning shift and then in the evening. as sometimes we only work 2 hours between 7-18 and then 8 after that your help would be greatly appreciated

    TimeSheet.xls

  8. #8
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: How to calculate time range from 22:00 - 6:00

    Create a new thread, do not hijack someone else's.

  9. #9
    Registered User
    Join Date
    02-10-2012
    Location
    ireland
    MS-Off Ver
    Excel 2002
    Posts
    8

    Re: How to calculate time range from 22:00 - 6:00

    ok was just posting it here as my issue relates and this one appears to be solved made more sense to me

  10. #10
    Registered User
    Join Date
    10-04-2013
    Location
    Bornholm, Danmark
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: How to calculate time range from 22:00 - 6:00

    Premium.xlsx try this file

  11. #11
    Valued Forum Contributor
    Join Date
    10-29-2012
    Location
    Mojokerto,Indonesia
    MS-Off Ver
    Excel 2007
    Posts
    554

    Re: How to calculate time range from 22:00 - 6:00

    may be like this
    =(D2-C2+1)*24

  12. #12
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,053

    Re: How to calculate time range from 22:00 - 6:00

    BjarneHansen and Ghozi Alkatiri ...

    Your post does not comply with Rule 7 of our Forum RULES. Please do not ignore requests by Administrators, Moderators and senior forum members regarding forum rules.

    If you are unclear about the request or instruction then send a private message to them asking for clarification. Do not post a reply in a thread where a moderator has requested an action that has not yet been complied with e.g Title change or Code tags...etc
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  13. #13
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: How to calculate time range from 22:00 - 6:00

    Post deleted as per request by moderator.
    Last edited by newdoverman; 11-25-2013 at 11:54 AM.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

+ 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