+ Reply to Thread
Results 1 to 9 of 9

24 Hour Rota

  1. #1
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    24 Hour Rota

    Hi,

    Attached is a time sheet which has shifts that can either start and finish in the same day or at times start one day and finish in the next.

    My problem is that I want to total the hours worked in a shift/week and when a shift starts in one day and finishes in the next then I get an error in the formula.

    Is there a more clever formula that I can use that will over come this?

    Thanks,
    Adam.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    05-27-2008
    Location
    Newcastle Upon Tyne UK
    MS-Off Ver
    XP Excel 2003
    Posts
    105

    Re: 24 Hour Rota

    Try this in R2:

    =IF(B2="Day Off",0,IF(B2="Hol",0,IF(C2<B2,(C2+24)-B2,B2-C2)))


    sorry I have hasd to amend this several times - this should be correct now


    edvwvw
    Last edited by edvwvw; 10-11-2010 at 08:43 AM.

  3. #3
    Forum Contributor Charlie_Howell's Avatar
    Join Date
    09-27-2010
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2007
    Posts
    218

    Re: 24 Hour Rota

    try this and let me know if this is what you are looking for
    Attached Files Attached Files

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

    Re: 24 Hour Rota

    Hi I have a spreadsheet that does what you require

    PM me and I will send you a copy

    Cheers

    Toonies

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

    Re: 24 Hour Rota

    @Toonies, if you have something to share please do so on the Board directly.
    Sharing of this nature is after all the general ExcelForum.com ethos

  6. #6
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: 24 Hour Rota

    =IF(OR(B2={"Day Off","Hol"}),0,MOD(C2-B2,1))

    is a shorter way, and allows you to add other text simply without nesting ifs
    Regards
    Darren

    Update 12-Nov-2010 Still job hunting!

    If you are happy with the results, please add to our reputation by clicking the blue scales icon in the blue bar of the post.

    Learn something new each day, Embrace change do not fear it, evolve and do not become extinct!


  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: 24 Hour Rota

    You could also only apply the hours calculation if both times are present, i.e.

    =IF(COUNT(B2,C2)=2,MOD(C2-B2,1))
    Audere est facere

  8. #8
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: 24 Hour Rota

    I didnt think that would work because of the merged cells!

    Nice!

  9. #9
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: 24 Hour Rota

    (as a side note =IFERROR(MOD(C2-B2,1),0), is even shorter in 2007/2010)

+ 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