+ Reply to Thread
Results 1 to 10 of 10

Formula to calculate last 20 games

  1. #1
    Registered User
    Join Date
    08-26-2021
    Location
    Vancouver
    MS-Off Ver
    365
    Posts
    5

    Post Formula to calculate last 20 games

    I would like to figure out how to show the last 20 games played in my spikeball league. It is played by 2 players on each team so the two winners are recorded in B and C, while losers are recorded in D and E. I have individual wins, losses, and games totaled, but I am unsure how to calculate the record of the last 20 games played by each player.

    I've seen other threads, however I'm having trouble trying to replicate those formulas because their sheets are much more detailed. I cannot link it because I am a new user.

    Any help is appreciated!

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,944

    Re: Formula to calculate last 20 games

    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    08-26-2021
    Location
    Vancouver
    MS-Off Ver
    365
    Posts
    5

    Re: Formula to calculate last 20 games

    I'm unable to attach a file because I am a new user.

  4. #4
    Registered User
    Join Date
    08-26-2021
    Location
    Vancouver
    MS-Off Ver
    365
    Posts
    5

    Post Re: Formula to calculate last 20 games

    Thank you for the heads up
    Attached Files Attached Files
    Last edited by BEEJAYLEE; 08-29-2021 at 02:40 PM.

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,944

    Re: Formula to calculate last 20 games

    Since you using Office 365, you can use Power Query which is called Get and Transform Data and found on the Data Tab. Look at the attached file to follow the step by step in the UI.

    Please Login or Register  to view this content.
    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    08-26-2021
    Location
    Vancouver
    MS-Off Ver
    365
    Posts
    5

    Re: Formula to calculate last 20 games

    Thank you alansidman, I appreciate your helpful links and explanation. I noticed the query table recorded the first 20 games each player played, however I would like the last 20 games instead.
    Last edited by BEEJAYLEE; 08-30-2021 at 01:40 AM.

  7. #7
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,648

    Re: Formula to calculate last 20 games

    Building on alan's proposal, I removed one row of the code so that it reads:
    Please Login or Register  to view this content.
    Next I added Column1 to the table on the Auto Season sheet populated using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Note that it may be possible to add that column in Power Query.
    On the Auto-Standings sheet the Winner and Loser columns are populated using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The Win% column is populated using: =G3/SUM(G3:H3)
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  8. #8
    Registered User
    Join Date
    08-26-2021
    Location
    Vancouver
    MS-Off Ver
    365
    Posts
    5

    Re: Formula to calculate last 20 games

    Thank you JeteMc, I appreciate your help!

  9. #9
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Formula to calculate last 20 games

    FWIW, if you wanted a formula approach, rather than PQ, then:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    the above would mirror the results per JeteMc's earlier file.

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,648

    Re: Formula to calculate last 20 games

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools menu above your first post. I hope that you have a blessed day.

+ 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. Calculate Result of Last N Games
    By mholland1187 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-10-2021, 11:39 AM
  2. Formula to Calculate Games Back - MLB Baseball Wild Card
    By rosetc16 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-26-2019, 12:45 PM
  3. [SOLVED] Formula to calculate amount of games played
    By brad2018 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-09-2018, 06:29 PM
  4. [SOLVED] Formula to calculate the FORM (win=3,draw=1,loss=0) of the last six games played
    By alsan in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 10-28-2017, 08:23 AM
  5. Formula to calculate win/lost for last n games
    By cap_investing in forum Excel General
    Replies: 13
    Last Post: 01-06-2015, 07:50 PM
  6. Replies: 7
    Last Post: 08-03-2013, 09:51 AM
  7. Replies: 6
    Last Post: 06-04-2013, 03:16 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