+ Reply to Thread
Results 1 to 22 of 22

Staff Calender - one person per day| Easy...Right?

  1. #1
    Registered User
    Join Date
    07-22-2015
    Location
    Colorado
    MS-Off Ver
    2013
    Posts
    6

    Staff Calender - one person per day| Easy...Right?

    Hello!

    I know there are a ton of staff scheduling questions and templates out there, however my need seems more basic. Basically, I make a monthly schedule for an office where only one person each day is assigned floor duty. There are 7 people in a rotation. The kicker is that I would like to be able to put in either their specific days "available to work" or days "requested off", whichever is better suitable for the programming. The other parameter would be maximum number of days a certain person could work. Would this be a Solver application or much more in depth, ei. VBA? This could also just be done using integers, 1-7, instead of using text for the names.

    It seems with all the templates and exe. out there, there should be something I could work with and manipulate. Any ideas?
    Last edited by ksto11; 07-23-2015 at 05:07 PM.

  2. #2
    Forum Contributor
    Join Date
    08-16-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2019
    Posts
    209

    Re: Staff Calender - one person per day| Easy...Right?

    Hi ksto11,

    do you have sample file how you imagine your file look like at the end ?

    Thanks
    Lex

  3. #3
    Registered User
    Join Date
    07-22-2015
    Location
    Colorado
    MS-Off Ver
    2013
    Posts
    6

    Re: Staff Calender - one person per day| Easy...Right?

    Here it is. Just a basic monthly calendar for the output. The second sheet would have the availability for each employee. Looking at it more, could this be done using if, ifthen, count, count if functions? I feel the formulas would get crazy long.

    FloorDuty_availability.xlsx


    Kyle

  4. #4
    Registered User
    Join Date
    07-22-2015
    Location
    Colorado
    MS-Off Ver
    2013
    Posts
    6

    Re: Staff Calender - one person per day| Easy...Right?

    So this formula

    =IF(Availability!C$3="y",Availability!$A$3,IF(Availability!C$4="y",Availability!$A$4,IF(Availability!C$5="y",Availability!A$5,IF(Availability!C$6="y",Availability!$A$6,IF(Availability!C$7="y",Availability!$A$7,IF(Availability!C$8="y",Availability!$A$8,IF(Availability!C$9="y",Availability!$A$9,"NEED")))))))

    will populate the calendar, however I'll end up with all the same people. How would I include the min/max days parameter?

  5. #5
    Forum Contributor
    Join Date
    08-16-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2019
    Posts
    209

    Re: Staff Calender - one person per day| Easy...Right?

    Hey,

    I have to create macro for it, give me a few days to figure it out -

    Cheers
    Lex

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

    Re: Staff Calender - one person per day| Easy...Right?


  7. #7
    Registered User
    Join Date
    07-22-2015
    Location
    Colorado
    MS-Off Ver
    2013
    Posts
    6

    Re: Staff Calender - one person per day| Easy...Right?

    Thanks for the Help! Still tinkering around.

  8. #8
    Forum Contributor
    Join Date
    08-16-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2019
    Posts
    209

    Re: Staff Calender - one person per day| Easy...Right?

    Hi,

    Attached sample rostering schedule, am able to make sure that a certain employee would not exceed the max days, however you nee to make sure to adjust their minimum days.

    Cheers
    Lex
    Attached Files Attached Files

  9. #9
    Valued Forum Contributor
    Join Date
    09-17-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    454

    Re: Staff Calender - one person per day| Easy...Right?

    I managed to get this configured as a solvable linear model using Solver only:

    Note: Solver is crippled by default to handle a maximum of 200 variables. You have 7 staff x 31 days = 217 variables, so I cut the date span to 28 days.

    See the attached file, and note the solver parameter and options settings (Excel 2007). To run it, go to Solver, you'll see the settings, just click Solve.

    FloorDuty_cy.xlsx

    solver1.JPG

    solver2.JPG

  10. #10
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Staff Calender - one person per day| Easy...Right?

    Hi ciyangou

    Just a short comment. As you have the constraint "$$21:$AC$21 = 1" you can set the taget cell to "Max" or "Min" if you like as the "$$21:$AC$21 = 1" will always ensure that the value in AD21 will be 28 as long as solver finds a solution to the problem.

    Nice model by the way!

    Alf

  11. #11
    Valued Forum Contributor
    Join Date
    09-17-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    454

    Re: Staff Calender - one person per day| Easy...Right?

    Hi Alf, I did notice that, the 28 target was just redundant. Thanks for your comment; and the rep!

  12. #12
    Forum Contributor
    Join Date
    08-16-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2019
    Posts
    209

    Re: Staff Calender - one person per day| Easy...Right?

    Hi Cyangou,

    That is a very good way of solving it! using problem solver. need to learn how to use that rather than using VBA!

    Cheers
    Lex

  13. #13
    Valued Forum Contributor
    Join Date
    09-17-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    454

    Re: Staff Calender - one person per day| Easy...Right?

    Thanks. It's easier than you might think. ksto11 has good instincts for suspecting that this could be solvable with the solver.

  14. #14
    Registered User
    Join Date
    07-22-2015
    Location
    Colorado
    MS-Off Ver
    2013
    Posts
    6

    Re: Staff Calender - one person per day| Easy...Right?

    Cyiangou, you are awesome, that is exactly what I was looking for to get my head back into excel. 6 years since I used solver in school. Now that i'v had time to play around with the model, I was able to add constraints to limit 1 shift every 4 days, however trying to avoid someone working back to back days seems to require too many constraints. Below is what i'v added.

    By using constraints for each person only working 1 day within a 4 day period, starting on day 1, then repeating this starting on day 2, logically this would keep at least 2 days in between shifts, however this requires too many constraints for solver.

    Any idea how to minimize the amount of cells I need to use?

    FloorDuty_Solver.xlsx

  15. #15
    Valued Forum Contributor
    Join Date
    09-17-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    454

    Re: Staff Calender - one person per day| Easy...Right?

    Hi ksto11

    Try this version. I can get a feasible solution if we relax the constraint and allow up to 2 days worked per moving 5 day period.

    If the 'Can work?' table was less restrictive, you can probably get the model solved for a 1 working day per 5 rule.

    FloorDuty_cy3.xlsx

  16. #16
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Staff Calender - one person per day| Easy...Right?

    Aside from the solution given by cyiangou there is another solver option you could try.

    Download the OpenSolver freebee developed by the University of Auckland, NZ.

    http://opensolver.org/installing-opensolver/

    Unzip the downloaded file to a folder of your choice.

    Start excel and open your file “FloorDuty_Solver.xlsx”

    Start Solver and check settings i.e. box “Make Unconstrained Variables Non-Negative” is ticked and “Simplex LP” is chosen as solving methode.

    Select “Options” and check box marked “Ignore Integer Constraints” is unticked.

    Close Solver and find the file “OpenSolver.xlam”. Double click on this file and you will get new icons to right of the original excel solver icon.

    Click on the icon marked “Solve” and that’s all. And yes it works without any problems on your "exstended" model (modified shift duty).

    As there is no artificial limits set on the size of the problem you can solve you can extend you model size as much as you wish. I.e. increase time period to 180 days for instance.

    The integration of OpenSolver in excel is temporarily, for a permanent integration of OpenSolver to excel see information in the “Download & Install” tab.

    Alf

  17. #17
    Valued Forum Contributor
    Join Date
    09-17-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    454

    Re: Staff Calender - one person per day| Easy...Right?

    This is fantastic Alf. How many years I've searched for an uncrippled free solver, I'd stopped looking. I will definitely try this out.

    BTW, I've just posted another solver solution here:
    http://www.excelforum.com/excel-form...ia-is-met.html

  18. #18
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Staff Calender - one person per day| Easy...Right?

    Good, I think you will like this solver version. It's much better than the excel one. So far I've only been using the linear OpenSolver model. There is one that works with non-linear problems so eventually I'll have a go at it.

    Checked you other solver solution and of cource I could not resist making some comments. Hope you don't mind.

    Thanks for the rep

    Alf

  19. #19
    Registered User
    Join Date
    07-22-2015
    Location
    Colorado
    MS-Off Ver
    2013
    Posts
    6

    Re: Staff Calender - one person per day| Easy...Right?

    Brilliant Alf! Loaded OpenSolver and BAM! Funny how now i am spending more time playing with this new Solver than I would have creating the calendar by hand. This really saved me a lot of time though and headaches from staring at a calendar full of crossed out names. Thanks again cyiangou, Alf, and Excelforum.com. Hopefully I can return the favor at some point.

    kyle

  20. #20
    Valued Forum Contributor
    Join Date
    09-17-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    454

    Re: Staff Calender - one person per day| Easy...Right?

    A pleasure Kyle. If you liked our contributions, please click 'Add Reputation' to the left of the persons' posts. You can also mark the thread as SOLVED using Thread Tools at the top. I had fun with this.

  21. #21
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Staff Calender - one person per day| Easy...Right?

    You are welcome.

    Thanks for feed back and rep.

    Alf

  22. #22
    Valued Forum Contributor
    Join Date
    09-17-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    454

    Re: Staff Calender - one person per day| Easy...Right?

    Sorry! Forgot you already gave! Thanks.

+ 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. VBA for auto populate staff vacation data to calender
    By qshngv in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-26-2015, 10:03 AM
  2. [SOLVED] Run calculations in template for 1 person, copy-paste results, repeat for next person
    By Geoff. in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-25-2014, 06:02 PM
  3. [SOLVED] Macro to update Score Card Summary when the new staff add-in or existing staff deleted
    By Faridwahidi in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-12-2014, 02:43 PM
  4. VBA to convert person-to-event into person-person
    By LuckyStrike in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-07-2014, 02:34 PM
  5. Replies: 8
    Last Post: 01-28-2014, 11:02 AM
  6. Providing how many times staff members have been late by staff ID
    By SG56001235 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-18-2013, 10:47 PM
  7. Staff Planner - How To Set Up UserForm to Generate Data into Staff & Date Spreadsheet
    By Marie Snell in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-19-2013, 11:04 PM

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