+ Reply to Thread
Results 1 to 7 of 7

filtering until one choice remains

  1. #1
    Registered User
    Join Date
    07-15-2009
    Location
    Belgium
    MS-Off Ver
    MS365 Excel Version 2402
    Posts
    18

    filtering until one choice remains

    Good evening

    30 students can choose between 20 songs whom they have to discuss in class.
    They can give their 1st preference, second prference and so on till 7th preference.
    After giving in prferences, each student receives his/her song, taking into account as much as possible their 1st preference, then 2nd and so on.
    But each song may only be used once so that students can not cheat.
    Can I do this in a simple Excel form and sort afterwards?

  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,623

    Re: filtering until one choice remains

    But how:
    30 students can choose between 20 ...
    But each song may only be used once
    So first 20 students will use-out all available songs. How about remaining 10 students.

    BTW. Sample workbook would help. So prepare one. May be mini version - say 6 students and 4 songs and mock-up solution manually.
    Best Regards,

    Kaper

  3. #3
    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,852

    Re: filtering until one choice remains

    Administrative Note:

    Is your forum profile showing the Excel PRODUCT that you need this to work for?

    Members will tailor the solutions they offer to the Office PRODUCT (Excel, NOT Windows) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your product is for Mac, please also state this.

    The three most recent Excel products are Excel 2019, Excel 2021 and MS365 - if you are using MS365, please give this name along with the version number in your profile (e.g. MS365 Version 2306). This is in the About Excel section further down the Account page.

    Thanks.
    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.

  4. #4
    Registered User
    Join Date
    07-15-2009
    Location
    Belgium
    MS-Off Ver
    MS365 Excel Version 2402
    Posts
    18

    Re: filtering until one choice remains

    Updated actual Excel version.
    If I have 30 students whom can choose 5 songs out of a list of 20 songs in total, then I have 30 students with each 20 songs, then I have 600 possible choises. Of course, some will choose same songs but the preferences of which song they listed first will be determining to give them the song they listed first. In the attached exampel, I mad d-the choice manually...
    Thanks so far for the help
    Attached Files Attached Files
    Last edited by daliti; 03-24-2024 at 01:20 PM.

  5. #5
    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,623

    Re: filtering until one choice remains

    Well, The situation presented in a file is only similar to one in description.
    There are 29 students
    There are unique 26 songs.
    Note that in some cells you have either space after song title or a typo. With these, there would be 29 unique titles.

    But let's focus on 29/26 situation. 3 songs shall be assigned to 2 students, the remaining 23 one song to one student each.

    As students made first-second-third... choice it would be nice to assign then their 1st choice if possible, if not 2nd choice, and so on.
    In sample file "The bigger picture", even if present in preferences of Laurens Bintein and Rune Noë was not assigned to anyone.


    As for the solution - I don't have (at the moment) wholy automatic one..

    I tried solver for whole set, but having few songs which are present only in one or two students choices, and not having all choices of students filled in (one student gave only one answer) didn't led me to acceptable results.

    So this semi-automatic is described below.

    First I'd locate the songs which are on the list of only one person, these are: All together now, Green Day, Land of the Free, Rage Against, Rock the casbah, The man.
    They are conditionally formatted with red font, to be better visible

    See the list of unique titles in column P and total count of a song in Q (sorted on Q).
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Iv'e sorted list of students and preferences (columns B:H) based on lowest popularity of their selected song (see column I):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and obviously students who selected the unique song will be assigned this one, like Julie Ampe and Marie Barbier theit respectively 4th and 1st choice (The nan and Green Day), and so on.

    Then for songs selected by two persons: Alright, Help is coming, The bigger picture, What's going on
    They are conditionally formatted with green font, to be better visible.

    Some choices are pretty obvious also here.
    Fee Meersschaert has the first choice of Help is coming (it's also 3rd choice of Michelle Hillebrant, so worse one).
    Rune Noë 3rd choice (the same as Fee's) is Alright - obviously assigned.
    Laurens Bintein 3rd choice (and 5th of Rune's) is The bigger picture - assigned.
    and finally Ella Ghesquière 3rd choice (it's 5th of Margaux) is What's going on - assigned.

    all these preassigned songs are marked with green background.

    The rest of students - they selected more frequent choices - i tried to use solver for assignment.
    I started with assigning all of them their first choice as a solver variable, made constraints that the choice cannot be larger than the total number of their answers - column H:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and cannot be lower than 1. The next constraint is that choice has to be an integer number, and count of any of assigned songs cannot be larger than 2 (column R):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    By the way - in column L is a title of a selected song:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    And as for goal for solver - I wanted to have as many first choices as possible - if not second choices, and so on. but as some songs are very frequent I decided to weigh this position with the frequency, to promote their selection.

    so the weighted choice is (column N):
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and for the goal I used also requirement of possibly small variation. It showed to be mych beter solution than forcing every song being assigned at least once in constraints. But as variation would be a small number, I emphasized it's meaning by multiplying by large factor (1000).

    and the goal cell N33 is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Well, after running Solver with evolutionary engine we have our results :-)


    And final note - the results could and will be different every (almost) time you run solver. This is quite typical for evolutionary engine. But their quality is similar. results of some runs are presented in columns U:Y
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    07-15-2009
    Location
    Belgium
    MS-Off Ver
    MS365 Excel Version 2402
    Posts
    18

    Re: filtering until one choice remains

    Waw, Kaper, you made a big effort for me.. I will look to it in teh weekend trying to understand how you did it and what you did .
    Thanks a lot

  7. #7
    Registered User
    Join Date
    07-15-2009
    Location
    Belgium
    MS-Off Ver
    MS365 Excel Version 2402
    Posts
    18

    Re: filtering until one choice remains

    It would have been better if the same dropdown list with songs was inserted in column 1 till 4 (1st till 4th choice).
    Some students made only a choice for 2 songs where 4 were asked, thta's the reason for the empty cells.
    Anyhow, you did a great job for me.. analyzing the problem like you did was anyhow impossible for me.
    Last edited by daliti; 03-27-2024 at 03:06 PM.

+ 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. Multiple Time Stamps depending on choice in Drop Down List Choice
    By insayah in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-25-2022, 09:53 AM
  2. Data remains unchanged
    By santhoshkuttan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-19-2016, 11:36 AM
  3. Make an multiple choice quiz with randomized choice
    By shaterroi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-16-2015, 11:04 AM
  4. sum filtered list that remains accurate when filtering changes
    By GCIBrian in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-22-2015, 01:35 PM
  5. Replies: 3
    Last Post: 12-09-2013, 04:21 AM
  6. Replies: 2
    Last Post: 07-10-2012, 04:37 PM
  7. Excel 2007 : Worksheet remains open
    By pedro35 in forum Excel General
    Replies: 0
    Last Post: 11-12-2008, 05:05 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