Google Sheets: FILTER, RANK
This week I was asked to provide a list of the top two student grades in each of the 100 classes in our university program.
Normally, this would be a pretty easy task if there were only a half dozen or so classes. Simply sort by group (class) and then Grade. Finally, copy and paste the top 2 ranked students of each group in a new sheet – print and hand to the boss.
However, with 100 classes this was going to turn into a time-consuming chore and one that could be prone to errors.
To solve this problem, I took advantage of Google Sheets RANK.EQ and FILTER formulas. Let’s take a peek at the formula now and go through the steps in detail later.
1 |
=RANK.EQ(D2,FILTER(D:D,C:C = C2)) |
1 |
=RANK.EQ(Grade,FILTER(Grade Column, Group Column = Group)) |
Let’s move on to an example.