+ Reply to Thread
Results 1 to 3 of 3

How to randomly assign names with maximum times (VBA or formula)

  1. #1
    Registered User
    Join Date
    04-20-2018
    Location
    Costa Rica
    MS-Off Ver
    2013
    Posts
    7

    How to randomly assign names with maximum times (VBA or formula)

    Hello Excel experts!

    I have a list of people that needs to have cases assigned.

    The formula can be added in the Assignee column (Cases sheet, Column C).

    This needs to be randomly however with a maximum of repeat times based in another cell value.

    Example:

    Member Standard priority High Priority
    Andres 7 2
    Catalina 4 0

    * High Priority it's only when the Priority Level (Cases Sheet) is 3,4 or 5.
    * Standard priority is 1 or 2.

    Also if the task owner (Cases Sheet) is the same as the Assignee has to run random again until gets a different name.

    I haven't tried a formula as I can execute randbetween but I strictly need the that if has a maximum of assigments count.
    Attached Files Attached Files

  2. #2
    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,864

    Re: How to randomly assign names with maximum times (VBA or formula)

    Hi,

    Formula will not be easy here.

    I first tried to use Solver, and it worked fine for such a limited set of data.
    But probably you have much more than presented (especially in sheet2), so I prepared a VBA code to deal with it.

    Please Login or Register  to view this content.

    Note1:
    Formulas in Sheet1 (column F nad right) and Sheet2 - column J
    They can be removed and are there just to verify results.

    Note2:
    because of RndBetween used to assign staff to cases, people with highest capabilities (see Claudio in your sample) usually have less (proportional) load than those with lowest (as Catalina or Diego). Changing this would require change in random assignment procedure, which shall promote these with high numbers in columns C od D in Sheet1
    Attached Files Attached Files
    Last edited by Kaper; 05-21-2018 at 07:36 AM. Reason: removed Debug.Print lines from the code - do the same in the file to speed it up.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    04-20-2018
    Location
    Costa Rica
    MS-Off Ver
    2013
    Posts
    7

    Re: How to randomly assign names with maximum times (VBA or formula)

    That's was I was looking for!

    Thank you very much Kaper!

+ 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. Randomly assign to a group with a maximum group size
    By sunsoar77 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-25-2016, 09:18 PM
  2. [SOLVED] Formula to randomly assign one of four values to a cell
    By harryadkins in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-23-2016, 04:37 AM
  3. Replies: 2
    Last Post: 11-20-2015, 03:10 PM
  4. Replies: 7
    Last Post: 10-07-2015, 03:01 PM
  5. Randomly assign to groups, without duplicates
    By rw2 in forum Excel General
    Replies: 5
    Last Post: 05-08-2015, 08:31 AM
  6. Randomly assign a value to rows
    By covegolfer in forum Excel General
    Replies: 3
    Last Post: 06-13-2011, 12:29 PM
  7. How do I randomly assign values in a grid?
    By Excel question in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2005, 08:05 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