+ Reply to Thread
Results 1 to 11 of 11

Auto-populating roles based on list of authorisations

  1. #1
    Registered User
    Join Date
    02-18-2020
    Location
    Lancaster, England
    MS-Off Ver
    2016
    Posts
    3

    Auto-populating roles based on list of authorisations

    Hello all,

    I'm hoping someone could help me with this...

    I'm trying to to get excel to automatically populate a nominee for a task based on data from a table that has those nominee names plotted against authorisations for those tasks (as shown in the attachment) I've tried nested IF functions etc, however that results in duplicate nominee names. Any help/ideas would be much appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Auto-populating roles based on list of authorisations

    Hi and welcome
    could you please add expected results manually? Thanks

  3. #3
    Registered User
    Join Date
    02-18-2020
    Location
    Lancaster, England
    MS-Off Ver
    2016
    Posts
    3

    Re: Auto-populating roles based on list of authorisations

    Hi,

    Thanks for the welcome - apologies for not providing enough information. I've updated the attached sheet, essentially I've got a list of employees plotted against a number of task authorisation as shown in A1:D8

    I'm wanting to populate cells F3:F5 with who's in manually, and excel automatically assign available nominees to tasks as shown in F8:H8 without any duplicates...

    Hope that makes sense,

    Thanks
    Attached Files Attached Files

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,615

    Re: Auto-populating roles based on list of authorisations

    One of possible approaches could be by using Excel Solver. It's a standard tool included with Excel, but not active. If you are not familiar with it you may start with Office help: https://support.office.com/en-us/art...c-e24772f078ca

    The Model I prepared uses task numbers (names of the tasks can be just names) which are assigned to available staff.
    The numbers are in G3:G5 (gray area). These are variables for the model. You can write there any initial set of numbers - for instance assign all to task 1 :-)

    Then the formulas in column H (yellow cell and copied down) calculate how many occurences of given task is assigned (if you wrote all staff task 1 of course there will be 3 in all cells). its simple countif
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    We will use this information as a required condition in solver - all countifs shall return 1 so no post has double assignment.

    In column I we check if given person is authorized to work on this pre-assigned post. The formula is here a bit more complicated (because B2:D8 contains texts. Would be easier if there were only 1 for aut and 0 for non-auth). but basically it's Index/Match formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Then we sum it all (green I6) and this cell will be the aim for our model we want here number 3 that shows number autrorised persons on their posts.

    The solver will try to change cells in G3:G5 this way to end up with all cells in H being 1 and sum in I6 reaching 3

    If you open the solver you will notice that there are also 3 other limits set: every value in range G3:G5 has to be integer (no fractions allowed) has to be larger or equal 1 and less or equal 3

    Now after pushing Solve button in solver after few seconds you will get the solution.

    To make life easer assigned tasks are shown not by theit numbers but with names assigned to them in row 8 with formula in F8 (again index/match type) and copuied right is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Install Solver and try it. Try to select Jack, Frank and Scott and notice Solver will not find a solution (as none of them is authorized for task 1).

    The solution is in Sheet2 of attached file.
    In sheet1 you will find solution usin binary values, but as I assume you have more posts than just 3 and more staff - the one proposed in Sheet2 would be better scaleable to larger tasks.
    Attached Files Attached Files
    Best Regards,

    Kaper

  5. #5
    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: Auto-populating roles based on list of authorisations

    Interesting solution on Sheet2, but it seems to me that it should be possible to limit the constraints to only two rows i.e.

    Please Login or Register  to view this content.
    Alf

  6. #6
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,615

    Re: Auto-populating roles based on list of authorisations

    Indeed, Alldiferent makes sense, and would allow not using column H formula (and limits), so probably a bit quicker computations.
    But I think it's anyway needed to give upper and lower limits to changed cells. So we still need 4 rows of constraints

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    the file could be modified to use less natural (in non-programmers sense) numbering of tasks 0-2 but anyway upper limit (of 2) would be needed, and selected a "hidden constraint" of reqired all non-negative values checkbox .

    Best,
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    02-18-2020
    Location
    Lancaster, England
    MS-Off Ver
    2016
    Posts
    3

    Re: Auto-populating roles based on list of authorisations

    Thanks very much for your help Kaper & Alf,

    I've expanded on your example to include 5 tasks in the uploaded sample, I also have a 6th (and final) task that requires 6 people - and I can't think of how to tie this in with the existing constraints within the solver, as it conflicts with the constraints that provide the "no repetition"

    I also wanted to include a team of varying size (there may be 12 - 18 people in but only 12 slots to fill, leaving a varying number of people spare)

    Once again - Thanks for your help on this, it's really appreciated,

    Dunk3k
    Attached Files Attached Files

  8. #8
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,615

    Re: Auto-populating roles based on list of authorisations

    If only the last task requires more than 1 person, the easy thing would be to use 1-12 as variables (column K with repetitions was not needed if we stick to AllDifferent constraint - so I deleted it)
    I added a row with number of staff required
    But as I said - with the model from the attached file only last task could absorb more than one person. So if you need say 2 persons for task 3, an easy workaround would be to make extra column for task 3b - could have exactly the same heading - we dont use it
    I added also formula for counting of staff available today and this is already used in a model. So no need to manualy change model parameters!

    OK, have to go off-line, but hope the formulas are rather easy to understand. SPARE staff member(s) obtain tasks with a number greater than total number of staff needed and are listed in extra column.

    The model has now the aim set to maximum (not equal to some value) this way it laso dont have to change after changing available staff list. The staff avaliable shall be inserted in or deleted from the middle part of the table in columns I:K - this way we will avoid problems with ranges in formulas.

    The same with inserting new staff in main table (A:G) - also insert rows in the middle, writhe autrorizations and (if needed) sort the table.

    Play with the file :-)
    Attached Files Attached Files

  9. #9
    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: Auto-populating roles based on list of authorisations

    From the FrontlineSolvers home page:

    A constraint such as A1:A5 = alldifferent, where A1:A5 are decision variable cells, requires that these cells must be integers in the range 1 to N
    so this makes the constraint "Integer" superflushious and as the range of "AllDifferent" must be in the range 1 to N then the constraint "$J$4:$J$15>=1" can also be deleted and as the range J4:J15 is set to "AllDifferent" the numbers in that range will go from 1 to 12 so the constraint "$J$4:$J$15<=$J$1" is also not needed.

    All this I didn't know before but your comments in post #6 made me dig into this problem so thanks to you I got a bit wiser

    Alf

    Ps Your new model is most impressive, will have to spend time in order to analyze the setup

  10. #10
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,615

    Re: Auto-populating roles based on list of authorisations

    Indeed, tried and it works.
    Alldifferent alone.
    My problem was that I used both alldifferent and integer. And integer required upper and lower bounds.

    So thanks for the discussion and "drilling down" the subject. Again, learned somenthing new at forum.

  11. #11
    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: Auto-populating roles based on list of authorisations

    You are welcome and thanks for feedback and rep. By the way you can also run this problem as a "GRG Nonlinera" problem. Solver find a solution almost immediately and but result looks not that "impressive" as compared to the "Evolutionary" result.

    Alf

+ 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] Auto populating a calendar based on list
    By pauldaddyadams in forum Excel General
    Replies: 7
    Last Post: 01-19-2016, 05:15 AM
  2. [SOLVED] Auto populating cells with corresponding data based on Drop-down list.
    By Colortoned in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-29-2015, 04:15 PM
  3. Replies: 4
    Last Post: 05-19-2015, 11:53 PM
  4. Replies: 4
    Last Post: 03-26-2013, 07:36 AM
  5. Replies: 2
    Last Post: 09-24-2012, 10:39 PM
  6. Replies: 5
    Last Post: 07-06-2012, 02:03 AM
  7. Auto Populating List
    By sethmote in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-20-2010, 03:03 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