+ Reply to Thread
Results 1 to 15 of 15

Multiple Days Hourly staff count

  1. #1
    Registered User
    Join Date
    05-12-2010
    Location
    Adrian, MI
    MS-Off Ver
    Excel 2010
    Posts
    76

    Multiple Days Hourly staff count

    I posted one before and had no luck. So i am posting again. I have racked my brain for about 5 days now and have gotten no where. I am able to get it to work for 1 day but i need it to work for multiple days (31) to exact. I have it so it will lookup the start date but having trouble lookuping up end date or the between times.

    I want to be able to put in the person, position, date and time start in one cell and date and time end in another cell. The main tab then looks up all the data i enter and color codes it out as well as counts the number of staff at the bottom (i alread have done this)

    Please help. I am using excel 2007

    It is a big file but that is because of the code i already have in there to show what i want it to do.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: Multiple Days Hourly staff count STUCK!

    You were almost there. I have updated your sheet for Person 3 (row 6). I have changed the date headers to include date and time calculated off the Start Date in cell A2 (rather than have multiple headers separating out date and time) It also makes it easier to update the dates and times off a single cell reference (if you are planning to use the sheet month to month). I have also changed your VLOOKUP formulae. Let me know if you need me to explain any changes I have made.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: Multiple Days Hourly staff count

    A slight afterthought. The changes I've made will still only calculate between two dates and times at any given time. I take it that you want the data to remain for previous days once you have entered it?

  4. #4
    Registered User
    Join Date
    05-12-2010
    Location
    Adrian, MI
    MS-Off Ver
    Excel 2010
    Posts
    76

    Re: Multiple Days Hourly staff count

    Yes i would like them to remain the same, so when i put in all the dates and times for the month it will do all of them. I kind of get what you did but not really. Could you explain more? Also could you create one for the whole month? I could pay as well as i would like to get this problem solved.

  5. #5
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: Multiple Days Hourly staff count

    I've attached a solution. The VBA references formulae (MATCH) on the Data Schedule sheet to achieve what you want. It's a starting point i.e. there is no error handling (you could potentially overwrite previously entered data but you could probably get around this using Intersect in the VBA for example) and I haven't completely populated the spreadsheet with dates etc. so that you can expand on it. It works off a button "Update Chart Schedule" on the Data Schedule worksheet.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    05-12-2010
    Location
    Adrian, MI
    MS-Off Ver
    Excel 2010
    Posts
    76

    Re: Multiple Days Hourly staff count

    Awesome!!! Thank you so much.

  7. #7
    Registered User
    Join Date
    05-12-2010
    Location
    Adrian, MI
    MS-Off Ver
    Excel 2010
    Posts
    76

    Re: Multiple Days Hourly staff count

    One more question. I want to count all the weekdays for for the specified time. Example All the mondays at 12:00am and all the mondays at 12:30am, etc, etc.

  8. #8
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: Multiple Days Hourly staff count

    Could you attach an example of what you want to achieve?
    e.g. Do you want this between two dates?

  9. #9
    Registered User
    Join Date
    05-12-2010
    Location
    Adrian, MI
    MS-Off Ver
    Excel 2010
    Posts
    76

    Re: Multiple Days Hourly staff count

    Here is what i have so far. I guess the two dates would be the start and end April 1 to April 30 or cell A2 and B2
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: Multiple Days Hourly staff count

    Please could you clarify what you are trying to achieve and where you would want to have the results? Do you want to, for example, calculate the total number of staff working on a Thursday at 2.00PM in the month?

    In addition, it looks like you will be presenting data on a month by month basis. Would it be beneficial to set up worksheets for each month and then populate each of them from the Data Schedule sheet. This could be built into the VBA and you could then use it each year by changing the start date on each of the monthly Chart Schedule sheets?
    Last edited by pb71; 05-17-2010 at 12:50 PM.

  11. #11
    Registered User
    Join Date
    05-12-2010
    Location
    Adrian, MI
    MS-Off Ver
    Excel 2010
    Posts
    76

    Re: Multiple Days Hourly staff count

    if it can be done by each month that would be even better..

    an example would be like it looks at all the data in he charted tab and says
    12:00am on all the thursdays we have x amount of people working

    Thursdays in April
    12:00am 12:30am 1:00am
    25 29 35

    Then i am able to divided by the number of "Thrusdays" in April to get how many on average we have working during that time period.

    I beleive you are on the right track with your last post. THANKS AGAIN!!

  12. #12
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: Multiple Days Hourly staff count

    That clears things up. I will update the workbook so that it has 1 worksheet per month. If a shift overlaps months i.e. 04/30/2010 to 05/01/2010 then the data will be split between the relevant worksheets.

  13. #13
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: Multiple Days Hourly staff count

    I have attached an update that includes the points discussed previously. I have only added two worksheets for April and May. You will need to add worksheets for the other months (the worksheet names for each month must be 1 through 12 as I have made use of this in the VBA). Until you have added the changes, only enter dates for April and May on the Data Schedule for testing purposes. Once you have copied either worksheet 4 or 5 to create the new worksheet, update cell C2 on each new sheet with the corresponding month number to automatically update the date headers. You will also notice that I have included the split for shifts starting one month and ending the next.

    Let me know if you have any questions.

    I haven't accounted for a shift starting on December 31st and ending on January 1st, but you could apply data validation to the dates entered on the Data Schedule from 01/01 to 31/12 for each year (assuming you will have a separate workbook for each year). Alternatively, an exception could be built in allowing for one carry over day into January.
    Attached Files Attached Files
    Last edited by pb71; 05-18-2010 at 06:37 PM.

  14. #14
    Registered User
    Join Date
    05-12-2010
    Location
    Adrian, MI
    MS-Off Ver
    Excel 2010
    Posts
    76

    Re: Multiple Days Hourly staff count

    You are awesome. Highly recommended. Thank you so much

  15. #15
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: Multiple Days Hourly staff count

    You're welcome .

    There are further improvements that could be made. For example, if you have already entered data then you would not want to keep on re-populating the monthly sheets for that range. You could populate a column on your Data Schedule input sheet with a message depending on the success of a data transfer and then use that as a starting point for a subsequent data transfer. Also, if a shift range overlaps a previous entry you will want to flag this before continuing.

    I have built in limited error handling as a starting point i.e. you cannot enter a shift start date greater than the end date. Additionally you cannot have a shift start and end date greater than one month (you will probably want to reduce this based on maximum working hours).

    It will be good to see the finished article. Keep me posted and let me know if you have any questions or need some assistance.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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