代码之家  ›  专栏  ›  技术社区  ›  Damien Jones

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

  •  1
  • Damien Jones  · 技术社区  · 6 年前

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

    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能告诉我每个人三场比赛中最好的两场比赛吗?E、 g.在上面的例子中,如果克里斯参加了第三场比赛并获得了第一名,他的结果将是

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

    谢谢

    1 回复  |  直到 6 年前
        1
  •  0
  •   GretchenW    6 年前

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