每个主题前5名成绩

时间:2014-09-18 10:17:46

标签: excel excel-formula ranking

我有一份考试科目列表,学生编号以及每个科目的每个学生的分数。我想要做的是确定每个科目的前四名得分学生。

我目前拥有的数据示例:

+--------------------+-------------+------------+
|      Subject       | Student ID  | Test Score |
+--------------------+-------------+------------+
| Maths 1            | Student 001 |         78 |
| Maths 2            | Student 001 |         63 |
| English Lang       | Student 001 |         64 |
| English Lit        | Student 001 |         88 |
| Chemistry          | Student 001 |         89 |
| Biology            | Student 001 |         81 |
| Physics            | Student 001 |         42 |
| French             | Student 001 |         73 |
| Spanish            | Student 001 |         78 |
| German             | Student 001 |         67 |
| Engineering        | Student 001 |         38 |
| Design & Tech      | Student 001 |         57 |
| ...                |   ...       |        ... |
| ICT                | Student 002 |         95 |
| Physical Education | Student 002 |         73 |
| Law                | Student 002 |         37 |
| Sociology          | Student 002 |         66 |
| Art & Design       | Student 002 |         40 |
| Drama              | Student 002 |         51 |
| Dance              | Student 002 |         75 |
| General Studies    | Student 002 |         37 |
| Maths 1            | Student 003 |         56 |
| Maths 2            | Student 003 |         77 |
| English Lang       | Student 003 |         41 |
| ...                |   ...       |        ... |
| Sociology          | Student 003 |         48 |
| Art & Design       | Student 003 |         79 |
| Drama              | Student 003 |         61 |
| Dance              | Student 003 |         96 |
| General Studies    | Student 003 |         50 |
| Maths 1            | Student 004 |         45 |
| Maths 2            | Student 004 |         73 |
| English Lang       | Student 004 |         40 |
| English Lit        | Student 004 |         60 |
| Chemistry          | Student 004 |         77 |
| Biology            | Student 004 |         56 |
| Physics            | Student 004 |         69 |
| French             | Student 004 |         90 |
| ...                |   ...       |        ... |
+--------------------+-------------+------------+

到目前为止,我已经创建了一个数据透视表,其中主题为行标签,学生ID为列标签,测试分数总和为值,这给出了类似这样的内容:

+--------------------+-------------+-------------+-----+-------------+-------------+
|     Row Labels     | Student 001 | Student 002 | ... | Student 097 | Student 098 |
+--------------------+-------------+-------------+-----+-------------+-------------+
| Art & Design       |          88 |          85 | ... |          79 |          91 |
| Biology            |          81 |         123 | ... |          70 |          56 |
| Business Studies   |          64 |         124 | ... |          47 |          51 |
| Chemistry          |          89 |         100 | ... |          41 |          77 |
| Dance              |          67 |         170 | ... |          96 |          36 |
| Design & Tech      |          57 |         131 | ... |          31 |          89 |
| Drama              |          35 |         130 | ... |          61 |          61 |
| Engineering        |          38 |         125 | ... |          38 |          58 |
| English Lang       |          64 |         102 | ... |          41 |          40 |
| English Lit        |          88 |         160 | ... |          81 |          60 |
| French             |          73 |          92 | ... |          69 |          90 |
| General Studies    |          37 |         125 | ... |          50 |          63 |
| Geography          |          41 |         117 | ... |          89 |          93 |
| German             |          67 |          77 | ... |          33 |          89 |
| History            |          85 |         176 | ... |          82 |          79 |
| Home Economics     |          89 |         155 | ... |          71 |          46 |
| ICT                |          85 |         179 | ... |          82 |          63 |
| Law                |          46 |         102 | ... |          72 |          68 |
| Maths 1            |          78 |          98 | ... |          56 |          45 |
| Maths 2            |          63 |         137 | ... |          77 |          73 |
| Physical Education |          82 |         138 | ... |          30 |          80 |
| Physics            |          42 |         108 | ... |          40 |          69 |
| Religious Studies  |          66 |         113 | ... |          95 |          73 |
| Sociology          |          87 |         152 | ... |          48 |          59 |
| Spanish            |          78 |         152 | ... |          70 |          50 |
+--------------------+-------------+-------------+-----+-------------+-------------+

然后,我使用了表格旁边的功能,为每行提供前5个分数。但是,我需要的是前5名学生ID和相应的分数,而不仅仅是分数。

长篇大论道歉,我希望这一切都有意义吗?

更新 -

理想情况下,我需要一个类似于以下内容的输出:

+--------------------+------------+------------+------------+------------+------------+
|                    |  Result 1  |  Result 2  |  Result 3  |  Result 4  |  Result 5  |
+--------------------+------------+------------+------------+------------+------------+
| Art & Design       | Student 92 | Student 88 | Student 85 | Student 62 | Student 94 |
| Biology            | Student 86 | Student 74 | Student 63 | Student 90 | Student 60 |
| Business Studies   | Student 56 | Student 66 | Student 77 | Student 97 | Student 97 |
| Chemistry          | Student 86 | Student 67 | Student 95 | Student 58 | Student 56 |
| Dance              | Student 91 | Student 65 | Student 76 | Student 82 | Student 87 |
| Design & Tech      | Student 57 | Student 60 | Student 91 | Student 85 | Student 92 |
| Drama              | Student 52 | Student 91 | Student 67 | Student 80 | Student 81 |
| Engineering        | Student 58 | Student 82 | Student 95 | Student 88 | Student 71 |
| English Lang       | Student 87 | Student 69 | Student 53 | Student 63 | Student 71 |
| English Lit        | Student 93 | Student 75 | Student 78 | Student 91 | Student 77 |
| French             | Student 76 | Student 64 | Student 92 | Student 63 | Student 80 |
| General Studies    | Student 53 | Student 95 | Student 97 | Student 51 | Student 82 |
| Geography          | Student 70 | Student 77 | Student 54 | Student 75 | Student 64 |
| German             | Student 90 | Student 50 | Student 60 | Student 73 | Student 92 |
| History            | Student 75 | Student 61 | Student 78 | Student 64 | Student 92 |
| Home Economics     | Student 89 | Student 75 | Student 92 | Student 60 | Student 70 |
| ICT                | Student 51 | Student 53 | Student 54 | Student 87 | Student 97 |
| Law                | Student 92 | Student 86 | Student 67 | Student 55 | Student 50 |
| Maths 1            | Student 64 | Student 88 | Student 50 | Student 71 | Student 91 |
| Maths 2            | Student 71 | Student 82 | Student 93 | Student 64 | Student 64 |
| Physical Education | Student 80 | Student 70 | Student 89 | Student 82 | Student 64 |
| Physics            | Student 93 | Student 78 | Student 94 | Student 55 | Student 53 |
| Religious Studies  | Student 92 | Student 80 | Student 70 | Student 57 | Student 63 |
| Sociology          | Student 58 | Student 51 | Student 91 | Student 68 | Student 71 |
| Spanish            | Student 88 | Student 93 | Student 79 | Student 71 | Student 76 |
+--------------------+------------+------------+------------+------------+------------+

2 个答案:

答案 0 :(得分:0)

数据透视表是个不错的选择。

将主题和学生ID(按此顺序)放入行标签字段。将测试分数放入值字段。

您需要右键点击第二列中的任何值>排序>从最小到最小

enter image description here

答案 1 :(得分:0)

创建上述支点后,

仅将值粘贴到新的空白Excel工作表。

现在将其转换为新的或相同的工作表...(快捷键是alt e + s + e)(所以现在主题是列,学生编号为行)

现在按主题从大到小排序(您将手动排序的次数与主题数量相同

替代: 忽略你做的上面的Pivot 使用学生编号创建一个新的数据透视表。在行中,列中的主题和从大到小的主题排序