+ Reply to Thread
Results 1 to 9 of 9

Football Fixture Results (How to find the last 5 fixtures involving a team)

  1. #1
    Registered User
    Join Date
    02-16-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    8

    Football Fixture Results (How to find the last 5 fixtures involving a team)

    Hey guys,

    Basically I have a table with fixtures and results. I need to be able to find the last 5 matches involving a team whether it be home or away. The column headers are below.

    Please Login or Register  to view this content.
    HFound and AFound record how many times a team has appeared at home or away. This is being used for another formula which uses Sumproduct to get the results for the last five home games for the home team involved.

    Is there a way I can use sumproduct to find the last 5 fixtures the team is involved in?

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,444

    Re: Football Fixture Results (How to find the last 5 fixtures involving a team)

    Suppose you have 380 fixtures (20 teams), then the last fixture should be on row 381. Using column I as a helper column, you could put this formula in I2:

    =IF(F2="","",B2&"_"&COUNTIF(B2:B$381,B2))

    which can then be copied down to the bottom of your fixture list. It will give a decreasing count of the games played by the home team, assuming that the result field is blank until a match is played. To get the rows of the last 5 matches for teamA, then, you just need a MATCH function to look for teamA_1, teamA_2 teamA_3, teamA_4 and teamA_5 in column I, and then you can use those rows in an INDEX function to return whichever parameters you need.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    02-16-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Football Fixture Results (How to find the last 5 fixtures involving a team)

    I dont have all the fixtures typed out. The table is being filled in as fixtures happen.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,768

    Re: Football Fixture Results (How to find the last 5 fixtures involving a team)

    Quote Originally Posted by Jose9Reyes View Post
    .....find the last 5 fixtures the team is involved in?....
    You say "find" - what does that mean exactly in this context - do you want a calculation involving those last 5 fixtures or an actual list of them.......or something else?

    Are the fixtures listed in date order (so the last 5 will be the bottom 5 positionally?)
    Audere est facere

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,444

    Re: Football Fixture Results (How to find the last 5 fixtures involving a team)

    Well, the formula is still valid - just make sure that you have $381 in the COUNTIF function if you have 20 teams.

    Note that the number is derived from 20 * 19, i.e. number of teams * (number of teams - 1) and then add one for your header row.

    If you are still confused, then post an example workbook - the FAQ describes how to.

    Hope this helps.

    Pete

  6. #6
    Registered User
    Join Date
    02-16-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Football Fixture Results (How to find the last 5 fixtures involving a team)

    Quote Originally Posted by daddylonglegs View Post
    You say "find" - what does that mean exactly in this context - do you want a calculation involving those last 5 fixtures or an actual list of them.......or something else?

    Are the fixtures listed in date order (so the last 5 will be the bottom 5 positionally?)
    I want to calculate how many times a team has won the game in their last 5 fixtures.

    Will give Petes idea a go now.

  7. #7
    Registered User
    Join Date
    02-16-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Football Fixture Results (How to find the last 5 fixtures involving a team)

    Petes method gets me the result (H, D, A). However now I have the problem of finding out if the Team was home or away in the fixture to be able to see if the result was a win for the home team or the away team?

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,444

    Re: Football Fixture Results (How to find the last 5 fixtures involving a team)

    I thought you were looking for the last 5 home results, so the formula only looks at column B (home team) and gives a count for those fixtures for the home team. You could have a similar formula in column J which looks at the away team. Often when you look at some fixtures it will show:

    TeamA (WWDWL) vs TeamB (LDWLW)

    where the last 5 results are for home games only or away games only.

    Hope this helps.

    Pete

  9. #9
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,768

    Re: Football Fixture Results (How to find the last 5 fixtures involving a team)

    If you have a specific team in K2 this "array formula" will give you the number of wins for that team in the last 5 games (home or away)

    =SUM((A$2:A$400>=LARGE(IF(B$2:C$400=K2,A$2:A$400),5))*((B$2:B$400=K2)*(F$2:F$400="H")+(C$2:C$400=K2)*(F$2:F$400="A")))

    confirm formula with CTRL+SHIFT+ENTER

    A2:A400 = Dates
    B2:B400 = Home Teams
    C2:C400 = Away Teams
    F2:F400 = Results ("H","A","D")

    You 'll get an error if the team has played fewer than 5 games - if you want all the wins in those games in that case change to

    =SUM((A$2:A$400>=LARGE(IF(B$2:C$400=K2,A$2:A$400),MIN(5,COUNTIF(B$2:C$400,K2))))*((B$2:B$400=K2)*(F$2:F$400="H")+(C$2:C$400=K2)*(F$2:F$400="A")))

    That will give you an error if there are no games for that team

    The above works even if the ranges are only partly populated.......and games can be in any order

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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