+ Reply to Thread
Results 1 to 19 of 19

Calculating Last 6 Results for League

  1. #1
    Registered User
    Join Date
    12-05-2020
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    27

    Question Calculating Last 6 Results for League

    Hello there!

    This is my second post on here. My first was a success so I am feeling optimistic about this one.

    So here is my question. I have created a spreadsheet on the English Premier League with all the current results and automatically updating tables and stats etc.

    What I would now like to do is create a section of my league table to have the results of each team's last 6 games (current form), so it would show win, draw or loss (ideally, green cell for win, yellow for draw and red for loss). I've searched all around the web but haven't found anything that can help me. The closest I've got is being able to calculate the last 6 home or away matches but I can't do that for all matches.
    Please see attached and help me out. I have got it set up so that all I need to do is enter the results of each match on the data sheet and everything else updates. If you go to the League Table sheet you will be able to see where I would like to add the "form" section.

    If anyone could help that would be great.
    Attached Files Attached Files
    Last edited by speedychaz94; 12-30-2020 at 08:26 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,729

    Re: Calculating Last 6 Results for League

    Please update your forum profile with the Office version you are using- Windows 10 is your OS and of little use to us. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Calculating Last 6 Results for League

    Hi
    what do you mean by last 6 matches?

    what would be the last 6 matches for Liverpool for example?

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,211

    Re: Calculating Last 6 Results for League

    Belinda, I am guessing but I would be pretty confident

    The last 6 matches are the last 6 matches the team has played, so in the case of Liverpool the 6 largest row numbers featuring Liverpool.

    Brighton Liverpool
    Liverpool Wolves
    Fulham Liverpool
    Liverpool Tottenham
    Crystal Palace Liverpool
    Liverpool West Brom


    The complication is that Liverpool can be home (the first Column) or away and so the results need to be interpreted as a win, if Brighton, Fulham and crystal palace are away wins, but the other 3 are home wins! similarly for losses.

    It has also not been stated if the most recent should be first, or last. I have seen tables both ways!, but it should be easy to swap the columns at the end regardless
    Last edited by davsth; 12-30-2020 at 06:13 AM.

  5. #5
    Registered User
    Join Date
    12-05-2020
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    27

    Re: Calculating Last 6 Results for League

    Ooops for some reason I thought it asked for operating system. I have MS Office 365.

  6. #6
    Registered User
    Join Date
    12-05-2020
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    27

    Re: Calculating Last 6 Results for League

    Quote Originally Posted by belinda200 View Post
    Hi
    what do you mean by last 6 matches?

    what would be the last 6 matches for Liverpool for example?
    Yes as davsth said. The last 6 matches a team has played. For example, Liverpool's last 6 matches are West Brom, Cystral Palace, Tottenham, Fulham, Wolves and Brighton.

  7. #7
    Registered User
    Join Date
    12-05-2020
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    27

    Re: Calculating Last 6 Results for League

    Quote Originally Posted by davsth View Post
    Belinda, I am guessing but I would be pretty confident

    The last 6 matches are the last 6 matches the team has played, so in the case of Liverpool the 6 largest row numbers featuring Liverpool.
    ...
    Spot on. Sorry if it's a little confusing. The column thing is exactly what I am struggling with. It would be a lot easier if it was all in 1 column (e.g. Liverpool - Win).

    Yes sorry I would like the most recent match first.

    Thanks.
    Last edited by AliGW; 12-30-2020 at 07:26 AM. Reason: PLEASE don't quote unnecessarily!

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

    Re: Calculating Last 6 Results for League

    You can use this array* formula in cell X4:

    =CHOOSE(MATCH($C4,INDEX(Data!$G$2:$L$400,LARGE(IF((Data!$A$2:$A$400=$C4)+(Data!$B$2:$B$400=$C4),Data!$M$2:$M$400),COLUMNS($X:X)),0),0),"W","D","L","W","D","L")

    *NOTE that an array formula needs to be confirmed using the key combination of CTRL-Shift-Enter (CSE), rather than the usual Enter.

    Then you can copy it across and down as required. The rows of the arrays are limited to 400, which is enough to cope with a full season's results.

    You can apply conditional formatting to those cells if you want to see the results in different colours.

    Hope this helps.

    Pete

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,729

    Re: Calculating Last 6 Results for League

    You won't need CSE in Office 365.

  10. #10
    Registered User
    Join Date
    12-05-2020
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    27

    Re: Calculating Last 6 Results for League

    Quote Originally Posted by Pete_UK View Post
    You can use this array* formula in cell X4:

    =CHOOSE(MATCH($C4,INDEX(Data!$G$2:$L$400,LARGE(IF((Data!$A$2:$A$400=$C4)+(Data!$B$2:$B$400=$C4),Data!$M$2:$M$400),COLUMNS($X:X)),0),0),"W","D","L","W","D","L")
    Pete thank you so much! This worked perfectly. I will break down this formula to see if I can understand it. The conditional formatting for the colours I can do myself.
    Last edited by AliGW; 12-30-2020 at 09:54 AM. Reason: PLEASE don't quote unnecessarily!

  11. #11
    Registered User
    Join Date
    12-05-2020
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    27

    Re: Calculating Last 6 Results for League

    Quote Originally Posted by AliGW View Post
    You won't need CSE in Office 365.
    Oh I never knew that. Learn something new everyday.

  12. #12
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Calculating Last 6 Results for League

    Hi Another option:

    X4 and across:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,729

    Re: Calculating Last 6 Results for League

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  14. #14
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Calculating Last 6 Results for League

    Here with the colors...
    Attached Files Attached Files

  15. #15
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Calculating Last 6 Results for League

    Please try spill array at X4

    =MID(INDEX(Data!$G$1:$L$1,INDEX(MMULT(N(SORT(FILTER(Data!$G$2:$M$400,(Data!$A$2:$A$400=C4)+(Data!$B$2:$B$400=C4)),7,-1)=C4),SEQUENCE(7)),SEQUENCE(,6))),6,1)
    Attached Files Attached Files

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

    Re: Calculating Last 6 Results for League

    Quote Originally Posted by speedychaz94 View Post
    ... I will break down this formula to see if I can understand it ...
    I've attached the file which also shows how the formula evolved. I put this part of the formula (which is the array part, so needs CSE in my version of Excel) in AI4:

    =LARGE(IF((Data!$A$2:$A$400=$C4)+(Data!$B$2:$B$400=$C4),Data!$M$2:$M$400),COLUMNS($X:X))

    This looks to see if the team in column C (Liverpool in this case) exists in either column A or column B of the Data sheet (note the + is equivalent to OR with arrays) and then returns the match number from column M of the Data sheet, and then the LARGE function takes the largest value (i.e. the most recent game for that team). When it is copied across the COLUMNS term changes and returns 2, 3, 4 etc. in successive columns, so the formula returns the 2nd highest match number, then the 3rd highest, and so on.

    I noticed that your Data sheet had already worked out who had won/drawn/lost and the name of the team being sought appears only once in columns G to L, so I figured if I can identify that group of cells for the row in question, then I can look for the name of the team and return its position. So, I then expanded the above formula to this (in AI5):

    =MATCH($C5,INDEX(Data!$G$2:$L$400,LARGE(IF((Data!$A$2:$A$400=$C5)+(Data!$B$2:$B$400=$C5),Data!$M$2:$M$400),COLUMNS($X:X)),0),0)

    The INDEX part (shown in red) picks out the 6 cells in column G to L of the Data sheet for the row given by the LARGE function, and then the MATCH part (in blue) returns the column number where the team name is found, and so this returns a number in the range from 1 to 6. (Obviously, this is now looking at Man United's results).

    Finally, I could change those numbers to W D L, and I used the CHOOSE function to do this.

    Hope this helps.

    Pete
    Attached Files Attached Files
    Last edited by Pete_UK; 12-30-2020 at 09:52 AM. Reason: changed H D L to W D L

  17. #17
    Registered User
    Join Date
    12-05-2020
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    27

    Re: Calculating Last 6 Results for League

    The INDEX part (shown in red) picks out the 6 cells in column G to L of the Data sheet for the row given by the LARGE function, and then the MATCH part (in blue) returns the column number where the team name is found, and so this returns a number in the range from 1 to 6. (Obviously, this is now looking at Man United's results).

    Finally, I could change those numbers to H D L, and I used the CHOOSE function to do this.

    Hope this helps.

    Pete[/QUOTE]

    A massive help thank you. Well explained. You clearly have lots of knowledge and experience to have been able to work that out. Maybe one day I will be at your level
    Now my next challenge is to be able to figure out how to insert an arrow (up or down) to teams that have moved up or down in the league since the last fixture. A bonus would to be able to have a number next to that arrow with how many positions the team has moved in the league. Don't worry I don't expect you to work this out. I will try it out myself first.

    Thanks again!
    Last edited by AliGW; 12-30-2020 at 09:53 AM. Reason: PLEASE don't quote unnecessarily!

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

    Re: Calculating Last 6 Results for League

    Thanks for your kind words - happy to help.

    I was thinking that in these days of congested fixtures, it would be nice if you recorded the date and kick-off time for each match in the Data sheet, and then you could answer questions like "when did Liverpool last play?", or "who has had the shortest recovery time between matches?", and so on.

    Regarding your query about the up/down arrows, you will need to know what the league position of each team was before the current (latest) results, so having the date/time recorded may also help you in that.

    Good luck, and I hope you have a Happy New Year (with muted celebrations in these lock-down times).

    Stay safe,

    Pete

  19. #19
    Registered User
    Join Date
    12-05-2020
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    27

    Re: Calculating Last 6 Results for League

    Oh that does sound very tempting. I think I might try that.

    Yeah I thought that I might need to add more data in order to be able to have the arrows.

    I'll see how I get on.

    Have a good one mate (well, as good as it can be). All the best for the new year.

    Stay safe,

    Charlie

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Calculating Football results/scores for Fantasy League
    By harrowerjohn in forum Excel General
    Replies: 7
    Last Post: 05-17-2020, 12:38 PM
  2. [SOLVED] Baseball Fixtures, Results and League Table
    By davo3286 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 06-11-2018, 12:59 PM
  3. Displaying Last X Results for Soccer League Table
    By Statto in forum Excel General
    Replies: 12
    Last Post: 07-06-2014, 05:09 AM
  4. Database Champion League Results
    By jiggahoe in forum Access Tables & Databases
    Replies: 2
    Last Post: 03-29-2013, 02:49 AM
  5. league table from results
    By sandy in forum Excel General
    Replies: 4
    Last Post: 09-26-2005, 03:05 AM
  6. league table from results
    By sandy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-25-2005, 03:05 PM
  7. [SOLVED] Create Formula for calculating Little League Age...
    By Brent in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-20-2005, 09:05 PM

Tags for this Thread

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