+ Reply to Thread
Results 1 to 13 of 13

Start Shift and an End Shift

  1. #1
    Registered User
    Join Date
    11-17-2009
    Location
    Chicago
    MS-Off Ver
    Excel 2003
    Posts
    11

    Start Shift and an End Shift

    I have a Start Shift and an End Shift time,

    Start Shift = 2009/11/10 09:27:06 (GMT-6:0)
    End Shift Time= 2009/11/10 15:13:03 (GMT-6:0)
    eg. Total Time = 5.3 hrs

    I would like to take if from this format, and calculate the total time difference. Sometimes the GMT codes may be -5:0 if that means anything. For the cell "Total Time" I only need it to have a decimal format.

    Thank You all that can help.
    G
    Last edited by ggovensky; 12-01-2009 at 10:20 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Start Shift and an End Shift

    What is wrong with the formula, end shift-start shift?

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Start Shift and an End Shift

    If you assume A1 is start and A2 is End then difference can be calculated with

    =LEFT(A2,FIND("(",A2)-1)-LEFT(A1,FIND("(",A1)-1)

    Based on your times that will generate a time value of 5:45:57 ... on that basis I'm not quite sure where you get your .3 from ?

    If you want the above in decimal format simply multiply result by 24, ie

    =24*(formula)

    Which would, based on times, generate the following rounded to 2 decimals: 5.77

  4. #4
    Registered User
    Join Date
    11-17-2009
    Location
    Chicago
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Start Shift and an End Shift

    Thank You All for your Help.EndShift-StartShift will not work with the (GMT-5) text in the line.DavesExcel. TY however.

    Donkey, this actually does work, however this is what I am coming up with.
    Please see attached. I've included the attachment with what I need to come up with and notes in the excel. Thank You for your help, I can see I am closer with the answer then I was two days ago.
    Attached Files Attached Files

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Start Shift and an End Shift

    First you need to ensure you're subtracting Start Time from End Time ... you presently have some mixed references in your formulae in H re: B/C, ie should read:

    Please Login or Register  to view this content.
    If your shifts can cross midnight (and do not exceed 24 hours in duration) it would be safer to encase the above in a MOD statement, ie

    Please Login or Register  to view this content.
    Then to account for decimal breaks etc... simply divide the total of D:E by 1440 (ie 24 * 60)

    Please Login or Register  to view this content.
    The above is still a time value... ie format to hh:mm:ss

    If you wish to convert into decimal hours multiply the whole number by 24

    Please Login or Register  to view this content.
    Remember to set format of H to be General / Number rather than Time if using the 24* method

    EDIT:
    Does it matter that the GMT values change - eg C3 vs B3 - do you need to account for the GMT shift in your calcs ? (ie are you at risk of comparing Apples to Pears ?)
    Last edited by DonkeyOte; 11-19-2009 at 09:43 AM.

  6. #6
    Registered User
    Join Date
    11-17-2009
    Location
    Chicago
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Start Shift and an End Shift

    It works great, expect GMT time needs to be considered. You are very thoroughly with your codes, this is fantastic! I used the last code.
    Last edited by DonkeyOte; 11-20-2009 at 07:07 AM. Reason: unnecessary quote removed

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Start Shift and an End Shift

    on which basis - if I've understood - perhaps then:

    Please Login or Register  to view this content.
    Based on your sample file the above would generate 3.42 & 6.12 respectively as opposed to 3.42 and 5.12 as was the case previously, ie an extra hour is added to the end time in C3 given the GMT is -5 as opposed to -6 as is the case with the start time in B3.

  8. #8
    Registered User
    Join Date
    11-17-2009
    Location
    Chicago
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Start Shift and an End Shift

    Quote Originally Posted by DonkeyOte View Post
    Based on your sample file the above would generate 3.42 & 6.12 respectively as opposed to 3.42 and 5.12 as was the case previously, ie an extra hour is added to the end time in C3 given the GMT is -5 as opposed to -6 as is the case with the start time in B3.
    Thats very true, it works great, besides the GMT. If GMT is less then 6 then the figure is incorrect. Do you have any suggestions?
    Last edited by DonkeyOte; 12-01-2009 at 09:45 AM. Reason: revised quote to nec. part

  9. #9
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Start Shift and an End Shift

    Can you elaborate by means of example(s) ?

  10. #10
    Registered User
    Join Date
    11-17-2009
    Location
    Chicago
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Start Shift and an End Shift

    Quote Originally Posted by DonkeyOte View Post
    Can you elaborate by means of example(s) ?
    Attached is the spreadsheet. 3 stores highlighted in orange are not calculating correctly.
    Attached Files Attached Files

  11. #11
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Start Shift and an End Shift

    Error on my part - simply change the addition of the GMT difference to the end time to be a subtraction:

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    11-17-2009
    Location
    Chicago
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Start Shift and an End Shift

    This works ! Wow, I have to say you are an expert at this! Thank You very much. Do you do this as a hobbie, or are you professor? Do you do any of this for cash? Anywho, thank You again. Iam sure I will have more to come.
    Last edited by DonkeyOte; 12-01-2009 at 10:13 AM. Reason: removed unnec. quote

  13. #13
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Start Shift and an End Shift

    Good, please remember to mark as SOLVED (see FAQ / How To for guidance if unsure).

    Quote Originally Posted by ggovensky
    Do you do this as a hobbie, or are you professor? Do you do any of this for cash?
    Presently the former. Preferably the latter.

    (on an aside please don't use the Quote button to reply - better to use the Post Reply button or worse case trim the Quote down to points pertinent to your reply - else the board becomes a little cluttered).

+ 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