+ Reply to Thread
Results 1 to 5 of 5

Solver and group rankings

  1. #1
    Registered User
    Join Date
    09-13-2014
    Location
    Rochester, New York
    MS-Off Ver
    2010
    Posts
    4

    Solver and group rankings

    Hello to all, first post here. If anyone has done anything in the past with ranking within groups in Excel then you may recall a lot of processing power is required to do it with large numbers of rows. Here's a hypothetical in my particular case, let's say we have data from ten years ago, test scores from a couple of thousand classrooms with maybe 20 students in each class. Each student is required to take five separate exams, one history exam, one math exam etc. After taking the exams I have ranked each student's score on each exam within that student's particular classroom. So here's what I have for each student, ClassroomID, StudentID, RankOnTest1,RankOnTest2,RankOnTest3,RankOnTest4,RankOnTest5.

    I want to use solver to find optimum weights on each exam for the highest ranking scores. As a starting point let's say a student's RankOnTest1 = 1, let's give 20 points for that and for the second best rank on that test let's start with 15 points and so on down the line to maybe the top five ranks get some points. Sum the points for each student on all five tests. Next, rank the students by that sum within each classroom, this particular ranking operation because it's done within groups (ClassroomID) is where the processing overhead occurs.

    Once we have the rankings, I want to essentially nominate the top ranked student within each class as the most likely to succeed. Now I have another column with current salary for each student ten years after graduation. For those students most likely to succeed I want to average their current salary. This salary is the cell I want solver to maximize. The cells I want solver to change are the points assigned to the ranks of the exams. The problem is, when the points change, the ranks change, this takes time and solver just seems to hang.

    Has anyone faced a similar problem? Would some tool other than solver be more appropriate in this scenario?

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Solver and group rankings

    I find that Solver is a fairly robust tool that can solve a lot of different kind of problems. It also seems that designing the spreadsheet is a significant part of the challenge of building these kind of solutions. I find that I generally must first understand the math behind my problem before I can effectively program a solution in the spreadsheet. When I tackle a problem like this, I tend to start with pencil and paper (or chalk and chalkboard, or similar) and spend some time with my equations trying to look at different ways of formulating the "objective function" (the equation that I will try to optimize) to find a variation that seems best suited to the optimization problem. I cannot tell if you have already done this step. If you have, can you share the equation you want to optimize? If you have not, then we will probably first need to do this "non-excel" step before we get too involved in Excel related questions. A small sample spreadsheet might be useful in this step.

    One of the first things I observe is that your problem uses "ranks". I'm guessing that you will intend to limit these variables to integers -- which will often tend to make this a "linear integer programming" type problem (I don't know if you have enough computer science or math education under your belt to be familiar with these kind of problems). Linear integer programming tends to take a lot more resources than other programming problems because of the difficulties that come from limiting variables to integers. One suggestion would be to try formulate the problem using continuous variables rather than discrete integer variables.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    09-13-2014
    Location
    Rochester, New York
    MS-Off Ver
    2010
    Posts
    4

    Re: Solver and group rankings

    Thanks for the reply. As for the ranks, they really aren't 'visible' to the solver itself, i.e. think of it as Solver is only changing the weights of the exams, which in turn leads to changes in the top scoring (ranked) person in a class who is the only person in each group (classroom) that I want to bucket for obtaining average salary. It's this average salary number that I want Solver to MAX simply by changing the weights of the exams, as such we can forget everything in between, though the in between is the problem here due to the computing overhead. Obtaining max within a group is simply not an optimized function in Excel -- in this case I'm being forced to use SUMPRODUCT or Array Formulas to identify the top scores in a group -- by contrast it's trivial to identify the top score in each group with something like a SQL query in MS Access.

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Solver and group rankings

    I agree that Excel is not as efficient of a database program as a database program. Of course, a database program doesn't usually have the more complex algorithms and functionality that a spreadsheet has. And there can be a certain performance penalty in trying to switch between applications. In many ways, you seem to understand (at least conceptually) the algorithm you are trying to implement and are perhaps more concerned with finding an efficient way to accomplish the task.

    Disclaimer: Since I don't do database work, I'm not very proficient in using Excel's database type functions, nor can I comment on other database applications. Others may have insights that I don't in applying some of those utilities.

    Without the details of your desired calculations, I can only offer some general suggestions.

    1) Have you optimized those =SUMPRODUCT()/array functions? Are you using full column references, or are you limiting the references to suitable used ranges? Sometimes I see a lot of "duplicated effort" in array functions, and a lot of improving spreadsheet performance is prorgramming it to eliminate this duplicated effort. In some cases, there seems to be a lot of performance gained by carefully identifying calculations that are being repeated by multiple instances of a function and structure the spreadsheet to eliminate the duplicated effort.

    2) I suspect that you could reduce the processing time by reducing the size of the database you are searching. Without the details of your algorithm, it is hard to be specific, but I wonder if the data could be "pre screened" to eliminate students who will almost certainly not be the solution. Perhaps a quick filter of the data to remove all students who score below a certain threshold would intelligently eliminate a large chunk of the database from consideration. At this point, only you would be able to look at the algorithm. I suspect that there could be performance gains by eliminating calculations that are highly unlikely to lead to the solution.

  5. #5
    Registered User
    Join Date
    09-13-2014
    Location
    Rochester, New York
    MS-Off Ver
    2010
    Posts
    4

    Re: Solver and group rankings

    Thanks again for providing good insight. I managed to find a suitable workaround by replacing the sumproduct / array formula I had been using and coded up a VBA routine to populate the rank column with the proper formula in each cell so that it's only looking within the small series of rows representing each classroom's range rather than the entire column. Since ColA ClassroomID is already sorted this works perfectly well, the prior method I had been using would only make sense if the column weren't sorted on the first place. I'm pleased with this result as solver is able to run without hanging -- thought I was dead in the water for a minute there.

+ 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. Solver and group rankings
    By ACR0123 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-13-2014, 09:52 PM
  2. Replies: 0
    Last Post: 07-20-2014, 12:45 PM
  3. Replies: 1
    Last Post: 02-10-2014, 10:26 PM
  4. Can't start Solver. Error message says Solver.xlam already open.
    By DaveHills in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 1
    Last Post: 10-21-2012, 11:02 AM
  5. converting weekly rankings into monthly rankings
    By sfinns in forum Excel General
    Replies: 6
    Last Post: 02-09-2012, 08:51 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