+ Reply to Thread
Results 1 to 8 of 8

Need a formula for allocations based on preferences and Priorties

  1. #1
    Registered User
    Join Date
    08-29-2017
    Location
    Delhi, India
    MS-Off Ver
    2016
    Posts
    5

    Need a formula for allocations based on preferences and Priorties

    Hello All,

    I have a problem wanted to solve using excel formulas. Let me try to explain the problem using an example - There are 5 vacant positions at location A for some X job, 4 vacant position at location B and 3 vacant position at location C. There are 12 candidates for these positions with Rank 1 to 12. Each of 12 candidates has filled preference of working on these locations. However, individual with Rank 1 (lower Rank) would be given preference in order to assign the locations (i.e., if there's only 1 position left at location A and individual of both Rank 1 and Rank 2 filled it as their first preference, then individual with Rank 1 will be priortized and get the position at location A.)

    I have attached an excel with sample input and expected result.

    I couldn't figure out the excel formula that will do this. It will be great to get your thoughts and help on excel formula with this.

    Many thanks in advance!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Need a formula for allocations based on preferences and Priorties

    To make the formula a bit more flexible, I added a small table in B19:C22 that indicates how many positions are available at each location. I then used the following formula in J6:

    =IF(COUNTIF($J$5:$J5,INDEX($D$6:$D$17,MATCH($H6,$B$6:$B$17,0))) < VLOOKUP(INDEX($D$6:$D$17,MATCH($H6,$B$6:$B$17,0)),$B$20:$C$22,2,FALSE),INDEX($D$6:$D$17,MATCH($H6,$B$6:$B$17,0)),IF(COUNTIF($J$5:$J5,INDEX($E$6:$E$17,MATCH($H6,$B$6:$B$17,0))) < VLOOKUP(INDEX($E$6:$E$17,MATCH($H6,$B$6:$B$17,0)),$B$20:$C$22,2,FALSE),INDEX($E$6:$E$17,MATCH($H6,$B$6:$B$17,0)),INDEX($F$6:$F$17,MATCH($H6,$B$6:$B$17,0))))

    You can fill the formula down through J17 for the rest of the candidates. The formula should respond automatically to changes in your preference table or changes in the new location availability table. Take a look at the attachment to see if this solution will work for you:
    Attached Files Attached Files
    If your problem has been solved, please use "Thread Tools" to mark the thread as "Solved".

    If you're grateful for this site's existence and would like to contribute to the community, please consider posting something hilarious in our joke thread:
    https://www.excelforum.com/the-water...ke-thread.html

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need a formula for allocations based on preferences and Priorties

    See if this recent solution helps. Posted by shg with upload post #8. You'll need to adapt it for the 5,4 and 3 vacancies variable and change your layout.

    https://www.excelforum.com/excel-gen...ml#post4726251

    Let us know if you want help with this.
    Last edited by FlameRetired; 08-30-2017 at 07:34 PM. Reason: afterthoughts
    Dave

  4. #4
    Registered User
    Join Date
    08-29-2017
    Location
    Delhi, India
    MS-Off Ver
    2016
    Posts
    5

    Re: Need a formula for allocations based on preferences and Priorties

    Hi CAntosh,

    The formula is working perfectly. Many thanks for your time and help on this.

  5. #5
    Registered User
    Join Date
    08-29-2017
    Location
    Delhi, India
    MS-Off Ver
    2016
    Posts
    5

    Re: Need a formula for allocations based on preferences and Priorties

    Hi FlameRetired,

    Thank you so much for taking out time for looking into this and sharing the link. That's really helpful!

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need a formula for allocations based on preferences and Priorties

    Thank you for the feedback and marking this thread Solved. It helps.

  7. #7
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Need a formula for allocations based on preferences and Priorties

    Glad we could help, good luck!

  8. #8
    Registered User
    Join Date
    01-22-2023
    Location
    London, UK
    MS-Off Ver
    Office 2019
    Posts
    1

    Re: Need a formula for allocations based on preferences and Priorties

    Hello!

    I was wondering if there was a way for the function to work without the ranking part - i.e. best possible allocation based on preferences.

    The rest of the function is very elaborate! Impressive!

+ 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. Class list generator based on friendship preferences
    By mrsamudala in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-20-2017, 04:11 PM
  2. Need help with Randomly Sorting people based on preferences
    By RoelKing in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-09-2016, 06:00 AM
  3. [SOLVED] Vlook up value with diffrent allocations
    By jajinka in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-19-2012, 10:04 AM
  4. Create or rank work groups based on preferences
    By stargroups in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-04-2011, 03:10 PM
  5. Replies: 0
    Last Post: 01-27-2011, 01:59 PM
  6. Generating name assignments based on user indicated preferences
    By exceluzer in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-16-2011, 04:52 AM
  7. Allocations of currency notes
    By mankothari in forum Excel General
    Replies: 3
    Last Post: 07-05-2008, 11:11 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