+ Reply to Thread
Results 1 to 12 of 12

Calculating total shifts worked across weekly sheets.

  1. #1
    Registered User
    Join Date
    06-30-2015
    Location
    Kent, England
    MS-Off Ver
    Office 13
    Posts
    6

    Calculating total shifts worked across weekly sheets.

    If anyone could help that would be great.

    I would like to compile a summary page of the amount of shifts a person has worked over a given period be it a year or monthly. I have attached a copy of the sheets in question.

    The summary page should look up the name in column A of a weekly sheet and return the value in Column AR and then add the value returned for each week together.

    I have included a broken formula on the summary page as to what I think I may be looking for but obviously I can't figure it out. To be honest im probably barking up the wrong tree and theres a different formula that I could use. I'm by no means experienced with Excel.

    =VLOOKUP(A6,'5.7.15'!A5:A8+'28.6.15'!A5:A8,COLUMN(AR),FALSE)

    The weekly sheet isn't in alphabetical as they are required to be in teams and usually there are 50+ names (8 teams) and I have weekly sheets for the whole year.

    I'm not even sure if it's possible. If not I will have to go through the whole sheet manually adding up each weeks shifts per person onto a monthly report.

    Many thanks in advance if anyone is able to assist.

    Jon.
    Attached Files Attached Files
    Last edited by JonJB; 06-30-2015 at 07:48 AM.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,369

    Re: Calculating total shifts worked across weekly sheets.

    See attached: "List" is named variable for the list of your worksheets

    The SUMPRODUCT formula should be entered with Ctrl+Shift+Enter
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    06-30-2015
    Location
    Kent, England
    MS-Off Ver
    Office 13
    Posts
    6

    Re: Calculating total shifts worked across weekly sheets.

    Thank you so much, it works perfectly. You answered that one far too quickly, could I possibly trouble you with another one concerning the same spread sheet.

    How could I calculate 13 consecutive shifts worked over the sheets. The people who are working are not allowed to work more than 13 out of 14 shifts at any given date.

    At the moment I use the shifts worked as an indication that a breech may occur using conditional highlighting and have to search back to the previous week to see when their 14th day would be for Rest.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,369

    Re: Calculating total shifts worked across weekly sheets.

    Not sure at this stage how to answer but to clarify the rule:

    Does 13 consecutive shifts mean 13 consecutive days (including weekends) or 13 shifts in ANY 14 day period (or any other definition!) ?

  5. #5
    Registered User
    Join Date
    06-30-2015
    Location
    Kent, England
    MS-Off Ver
    Office 13
    Posts
    6

    Re: Calculating total shifts worked across weekly sheets.

    13 consecutive days (including weekends) starting on any given day.

    So if they worked Sunday 14th June through to Friday 26th June, They would have to take the Saturday 27th off. If they were to take the 25th off sick for instance, the count would start again.

    Although if that's not possible, If it could work out Monday to Sunday for the last two weeks and show me a count so I could identify a breech which might occur in the planning stage after I've input the shifts for the following week. Even if it means I have to adjust the formula for each week I add.

    Edit: Apologies, I've reworded the first line.
    Last edited by JonJB; 06-30-2015 at 09:24 AM.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,369

    Re: Calculating total shifts worked across weekly sheets.

    Sorry for the delay in replying: unfortunately I have not been able to derive a solution (which does not mean there isn't one!): in particular there is need (for an ideal solution) to possibly look over 3 weeks of data and that could be rather tricky as the consecutive period could start on any day of the week.

    Hopefully one the experts might be able to help.

  7. #7
    Registered User
    Join Date
    06-30-2015
    Location
    Kent, England
    MS-Off Ver
    Office 13
    Posts
    6

    Re: Calculating total shifts worked across weekly sheets.

    Thank you for your help.

    I have managed to use your previous formula to show me two weeks shifts, when they get to 12 shift's it flags it up so I can check the Sunday prior to the two weeks, when planning weekend works.

    Thanks again John.

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,369

    Re: Calculating total shifts worked across weekly sheets.

    I have a VBA-based solution if this is acceptable. See attached with sheet "Consecutive_Shifts"

    I have added another week's data and added shifts to test.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    06-30-2015
    Location
    Kent, England
    MS-Off Ver
    Office 13
    Posts
    6

    Re: Calculating total shifts worked across weekly sheets.

    Hi John,

    I have added a couple of extra bits of data and some notes. Would you be able to take a look and see if you could adapt it.

    It looks like I have broken the macro adding the new people. Could you advise me as to why this occurred so I can transfer it to my actual file.

    Thank you.

    Edit: Solid Red Cells should have no data in them other than Red Fill. I just noticed one had a 1 in it which I forgot to remove.

    Edit 2: I've included the actual sheet with personal data removed so you can see the scale im working with.
    Attached Files Attached Files
    Last edited by JonJB; 07-01-2015 at 08:32 AM.

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,369

    Re: Calculating total shifts worked across weekly sheets.

    According to your own results "John Smith" worked 7 shifts (Mon to Sun) in WK1 and 6 in Wk2 (Mon to Sat) which I classify as 13 consecutive days: how do you get 5??

    I obviously don't understand the logic!

    The macro checks "Hours Ex Lunch" (I have just changed that test) and if > 0 the flag is set to 1.

    The formula in W finds the maximum number of consecutive 1s: hence 13 as answer.

  11. #11
    Registered User
    Join Date
    06-30-2015
    Location
    Kent, England
    MS-Off Ver
    Office 13
    Posts
    6

    Re: Calculating total shifts worked across weekly sheets.

    Your correct in the thinking, that is 13 consecutive days for week 1 and 2. Sorry it's my explanation. When I'm planning week 3. If a shift is missed it must start counting again from 1. Showing only the amount of shifts worked since the last day off up to the Sunday on the final week (5.7.15). (calculating to the final Sunday - Week 3 - as it should never be more than 13 shifts worked in past weeks if I've done my job right)

    I'm not sure I've explained that any better.

    If it's too much trouble don't worry I'll make do with what you've helped me with so far. It's already made my job a great deal easier.

    Edit:

    In my example, Where 28-Jun was taken off as a rest day. 14 days wasn't reached in week 1 or 2.

    So moving on I need it to show the amount of days worked in weeks 2 and 3 since the last day off.

    So if John Smith didn't work 20th Jun but then worked right from the 21st to the 3rd of July. That would be his 13th shift so would need the 4th off.

    In a sense, not when he has worked 13 shifts but if he will.
    Last edited by JonJB; 07-01-2015 at 10:27 AM.

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,369

    Re: Calculating total shifts worked across weekly sheets.

    Jon,
    I'll leave it be (unless I have a rare "eureka" moment.

    John

+ 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] Some shifts wont add on my staff rota weekly total
    By bigtiger1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-11-2013, 09:53 AM
  2. [SOLVED] Count the total number of shifts worked
    By Schoeii in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-03-2013, 12:41 AM
  3. Replies: 0
    Last Post: 04-25-2012, 05:42 PM
  4. calculating total time worked to measure SLA
    By billsoule in forum Excel General
    Replies: 4
    Last Post: 12-01-2010, 05:49 PM
  5. Calculating Total Time Worked on a
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 08-23-2005, 12:29 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