+ Reply to Thread
Results 1 to 7 of 7

Pivot Table that calculates Win/Loss record

  1. #1
    Registered User
    Join Date
    11-03-2017
    Location
    Wilmington, DE
    MS-Off Ver
    2013
    Posts
    29

    Pivot Table that calculates Win/Loss record

    Is there any way that a pivot table can calculate the win/loss record for a team where the result is the "Win" or "Loss" and the player is the ROWS, and the opponent is the COLUMNS?

    I have attached a spreadsheet that shows the data in the format that it comes in as. (columns A-C)
    The pivot table that displays the data in the only way that I could figure out how to do it (columns G-J)
    and how I would like the results to be displayed (columns L-P)


    A Team has a number of players. Those players play against each other. I have created a pivot table that can determine the wins and losses as separate columns, but the players and opponents both have to be in the ROWS section of the pivot table. I would like the Players to be the ROWS, and the opponent be the COLUMNS with the results displayed as "0-3" or "2-1" (W-L).

    If anyone has any ideas as to how to do this, I would be eternally grateful!
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,998

    Re: Pivot Table that calculates Win/Loss record

    I don't like Pivot Tables. give me a formula. Well, four to be exact. Variants of this:

    =COUNTIFS($A:$A,$L3,$B:$B,M$2,$C:$C,"Win")&" - "&COUNTIFS($A:$A,$L3,$B:$B,M$2,$C:$C,"Loss")

    diiferent shades = different formula in thesheet.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    11-03-2017
    Location
    Wilmington, DE
    MS-Off Ver
    2013
    Posts
    29

    Re: Pivot Table that calculates Win/Loss record

    Thanks Glen!

    I was heading down that path, but the problem is that I need the pivot table to auto-generate the Rows and Columns (there are a variable number of Players and Opponents. Is there a way to use a formula to auto-generate the Players and Opponents as the row headers and column headers?

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Pivot Table that calculates Win/Loss record

    something like that ?

    this is idea only
    Attached Files Attached Files
    Last edited by sandy666; 01-05-2018 at 04:46 PM.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,998

    Re: Pivot Table that calculates Win/Loss record

    H3, an array formula, copied down:
    =IFERROR(INDEX(Table1[Player],MATCH(0,COUNTIF(Table1[Player],"<"&Table1[Player])-SUM(COUNTIF(Table1[Player],"="&$H$2:H2)),0)),"")

    I2, an array formula copied across:
    =IFERROR(INDEX(Table1[Opponent],MATCH(0,COUNTIF(Table1[Opponent],"<"&Table1[Opponent])-SUM(COUNTIF(Table1[Opponent],"="&$H$2:H2)),0)),"")

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...

    the other formulae have been slightly modified to return blanks when required. The array formulae will return the player names in ALPHABETICAL ORDER.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-03-2017
    Location
    Wilmington, DE
    MS-Off Ver
    2013
    Posts
    29

    Re: Pivot Table that calculates Win/Loss record

    Thank you so much Glen! You've been most helpful! I tried to add to your reputation, but you must have answered another question for me b/c I was told to spread it around, but you deserve more reputation

  7. #7
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,055

    Re: Pivot Table that calculates Win/Loss record

    Post deleted.
    Last edited by josephteh; 01-05-2018 at 09:42 PM.

+ 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. Need pivot table which calculates daily outage %
    By siddharth_s1 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 02-18-2015, 12:52 PM
  2. Pivot Table, use VBA to get use back to record in source data table
    By gr8tday in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-17-2014, 01:30 AM
  3. Won/Loss record in a billiards tournament.
    By sandewal in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-25-2014, 12:39 AM
  4. [SOLVED] Calculate Opponents Win Loss Record
    By TGCRequiem in forum Excel General
    Replies: 8
    Last Post: 06-25-2012, 05:43 PM
  5. Replies: 1
    Last Post: 03-25-2010, 06:01 PM
  6. Ranking a W/L record (win/loss)
    By Jogier505 in forum Excel General
    Replies: 4
    Last Post: 10-11-2009, 07:25 PM
  7. loss of accuracy in pivot table
    By the swimmer in forum Excel General
    Replies: 3
    Last Post: 12-30-2005, 05:51 AM

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