使用Excel为比赛系列中的跑步者找到最佳成绩

时间:2018-02-22 17:05:44

标签: excel-formula excel-2013

假设我有以下两场比赛的结果列表:

Name    AG  League  Pos_In_League   Race
Gareth Gareth   V40 MALE V40-49 LEAGUE  1   Race 1
David David SEN MALE SENIOR LEAGUE  1   Race 1
Chris Chris V40 MALE V40-49 LEAGUE  2   Race 1
James James SEN MALE SENIOR LEAGUE  2   Race 1
Paul Paul   SEN MALE SENIOR LEAGUE  3   Race 1
Gareth Gareth   V40 MALE V40-49 LEAGUE  1   Race 2
James James SEN MALE SENIOR LEAGUE  1   Race 2
John John   V40 MALE V40-49 LEAGUE  2   Race 2
Chris Chris V40 MALE V40-49 LEAGUE  3   Race 2
David David SEN MALE SENIOR LEAGUE  2   Race 2
Peter Peter SEN MALE SENIOR LEAGUE  3   Race 2

从这个列表中,我想展示每个人获得的最佳结果。有些人可能只会做一场比赛,而有些人会做两场比赛。在这种情况下的结果将如下所示:

Gareth Gareth   V40 MALE V40-49 LEAGUE  1   Race 1
David David SEN MALE SENIOR LEAGUE  1   Race 1
James James SEN MALE SENIOR LEAGUE  1   Race 2
Chris Chris V40 MALE V40-49 LEAGUE  2   Race 1
Paul Paul   SEN MALE SENIOR LEAGUE  3   Race 1
Peter Peter SEN MALE SENIOR LEAGUE  3   Race 2

其中

Gareth did two races and finished first both times – both results are the same
David did two races and finished 1st in race 1 and 2nd in race 2 – best was 1st @ Race 1
James did two races and finished 2nd in race 1 and 1st in race 2 – best was 1st at Race 2
Chris did two races and finished 2nd in race 1 and 3rd in race 2 – best was 2nd at Race 1
Paul only did race 1 and came third so his best was 3rd at Race 1 
Peter only did race 2 and came third so his best was 3rd at Race 2

我可以使用Excel进行此测定,在每种情况下显示完整的数据行吗?

如果可以,那么第二个问题就出现了。如果引入第三场比赛,Excel可以告诉我每个人最好的两场比赛吗?例如。在上面的例子中,如果Chris做了第三场比赛并且先完成比赛,他的结果将是

Chris Chris V40 MALE V40-49 LEAGUE  2   Race 1
Chris Chris V40 MALE V40-49 LEAGUE  1   Race 3

谢谢

1 个答案:

答案 0 :(得分:0)

按名称(主要)和结果(次要,从最好到最差)对表格进行排序。 使用布尔值在右侧添加一列,当且仅当名称与上面的行不同时才会为真。然后过滤该列中的True结果。对于第二个问题,您可以允许名称与上面的两行不同。您将需要一些边缘条件用于表格的顶部。