+ Reply to Thread
Results 1 to 16 of 16

Automatic shift scheduler

  1. #1
    Registered User
    Join Date
    02-18-2019
    Location
    London, England
    MS-Off Ver
    2019
    Posts
    5

    Automatic shift scheduler

    Hi

    I want to create an automatic shift scheduler in Excel. I've included an example sheet. Basically I would like to create a table each month to schedule shifts for the employees. For each day there is a required number of employees (usually 4 but it can vary) and a maximum number of shifts for each employee per month. Also included in the table are the days certain employees aren't able to work (marked with an "X"). What I would need is Excel to fill out the table based on that criteria. If there are not enough employees with enough shifts to fill out the month, then I'd like it to just leave those cells empty.

    Any help would be appreciated

    Thank you!
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Automatic shift scheduler

    Welcome to the forum!

    I think you are going to need VBA for this - would you like me to move the thread for you?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    02-18-2019
    Location
    London, England
    MS-Off Ver
    2019
    Posts
    5

    Re: Automatic shift scheduler

    That would be great, thanks!

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Automatic shift scheduler

    All done.

  5. #5
    Forum Contributor banaanas's Avatar
    Join Date
    08-26-2014
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    199

    Re: Automatic shift scheduler

    Ah, this was a fun project

    See my attachment for a practical workbook.

    I really tried to create it to be as flexible as possible. You can add more employees, or days and the code will work.
    You can also manually add workdays, and the code will fill out the rest.

    There are a few things that need to stay the same:

    1. The first employer must be on row 2
    2. No values of the cells that have a Red background can be changed (i search for them in the code, this is what makes the rest so flexible)

    Here is the raw code if someone is interested:

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Tuomas "Banaanas" Savonius
    Trying to give back now when I actually can do some VBA

  6. #6
    Registered User
    Join Date
    02-18-2019
    Location
    London, England
    MS-Off Ver
    2019
    Posts
    5

    Re: Automatic shift scheduler

    Wow! You're absolutely amazing! I probably could have done it with a set table (with a bit of knowledge from Python) but this is flexible as well, which makes it just perfect.

    I feel like you've done so much for me but I have to ask - do you think there could be a way that I could make it fill the days randomly, so people don't get 2 days in a row (if random sticks a person 2 days in a row that would be fine)?

    I can't thank you enough again!

  7. #7
    Forum Contributor banaanas's Avatar
    Join Date
    08-26-2014
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    199

    Re: Automatic shift scheduler

    Sure I can try to modify it that way.
    Do you wan't it to be fully random, or do you only wan't to prevent that the same person doesn't get 2 days in a row?
    Is there any other limitations that you want to add?

  8. #8
    Registered User
    Join Date
    02-18-2019
    Location
    London, England
    MS-Off Ver
    2019
    Posts
    5

    Re: Automatic shift scheduler

    Fully random would be great. I think that would just put the icing on the cake.

  9. #9
    Registered User
    Join Date
    02-22-2019
    Location
    NY
    MS-Off Ver
    2013
    Posts
    1
    [QUOTE=banaanas;5069337]Ah, this was a fun project

    See my attachment for a practical workbook.

    I really tried to create it to be as flexible as possible. You can add more employees, or days and the code will work.
    You can also manually add workdays, and the code will fill out the rest.

    There are a few things that need to stay the same:

    1. The first employer must be on row 2
    2. No values of the cells that have a Red background can be changed (i search for them in the code, this is what makes the rest so flexible)

    Here is the raw code if someone is interested:

    Please Login or Register  to view this content.
    [/

    Hello. I am unable to see the code. I am trying to make a random schedule for 14 staff members to work a total of 13 shifts a month with all weekends off for everyone. Each employee works 3 shifts a week and one 4 shift week. I need to have 8 people working M,W,Th and F. Tuesday I need 10. Is this possible?

  10. #10
    Forum Contributor banaanas's Avatar
    Join Date
    08-26-2014
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    199

    Re: Automatic shift scheduler

    Alright see attachment for an entirely random solution.

    It got a bit messy, but the basic principle is this:
    Store all days in a collection. Create an array with randomised numbers (1 to count of days) use a loop to select dates randomly using this array's values.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  11. #11
    Forum Contributor banaanas's Avatar
    Join Date
    08-26-2014
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    199

    Re: Automatic shift scheduler

    Hello. I am unable to see the code. I am trying to make a random schedule for 14 staff members to work a total of 13 shifts a month with all weekends off for everyone. Each employee works 3 shifts a week and one 4 shift week. I need to have 8 people working M,W,Th and F. Tuesday I need 10. Is this possible?
    I am sure it is, but if you have trouble please open a new thread with your problems.

  12. #12
    Registered User
    Join Date
    02-18-2019
    Location
    London, England
    MS-Off Ver
    2019
    Posts
    5

    Re: Automatic shift scheduler

    My dude, you're absolutely incredible. Thank you so much for helping me out. I can't thank you enough! This is perfect!

    Kiitos paljon!

  13. #13
    Registered User
    Join Date
    01-06-2017
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    3

    Re: Automatic shift scheduler

    Hello. This solution works very well. I was wondering if there was a way to instead of putting a W on the day but to instead put a start and end time of work based on what that employee should be working that day?

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Automatic shift scheduler

    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread

  15. #15
    Registered User
    Join Date
    04-28-2021
    Location
    Austin, TX
    MS-Off Ver
    365
    Posts
    1

    Re: Automatic shift scheduler

    Hi Bannanas:

    I'm looking for something similar to Generate a the Schedule for our Church, Basically we have 30+ Volunteers that serve on Average 4 Services a Week, however, the biggest Issues is they all have different availability as to the days they can serve so it would be great for the Shift Scheduler to consider rules as to what days of the week they can serve.

  16. #16
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Automatic shift scheduler

    Quote Originally Posted by ricbrear View Post
    Hi Bannanas:

    I'm looking for something similar to Generate a the Schedule for our Church, Basically we have 30+ Volunteers that serve on Average 4 Services a Week, however, the biggest Issues is they all have different availability as to the days they can serve so it would be great for the Shift Scheduler to consider rules as to what days of the week they can serve.
    Did you perhaps miss the post IMMEDITELY above yours?

    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. 3 Questions on the "Employee Shift Scheduler" Template
    By Pai Mei in forum Excel General
    Replies: 3
    Last Post: 09-20-2017, 07:32 PM
  2. Shift Scheduler problem
    By vagg3lis in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-10-2015, 05:36 PM
  3. Replies: 0
    Last Post: 10-27-2014, 11:54 PM
  4. Running Excel from task scheduler. Scheduler doesn't end
    By tony h in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-31-2013, 09:49 PM
  5. Automatic Scheduler
    By Nuggetross in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-24-2013, 12:23 PM
  6. Want to make automatic scheduler
    By dragonlor20 in forum Excel General
    Replies: 0
    Last Post: 05-20-2012, 10:46 PM
  7. Shift cell focus automatic
    By anurag.agarwal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-03-2010, 01:36 AM

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