+ Reply to Thread
Results 1 to 9 of 9

Formula to Calculate Win/Loss Records from Sheet 1 to Sheet 2 After Filtering Data

  1. #1
    Registered User
    Join Date
    07-27-2022
    Location
    Colorado, USA
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    32

    Formula to Calculate Win/Loss Records from Sheet 1 to Sheet 2 After Filtering Data

    I have 2 sheets in the attached workbook. The main data comes into the "Game Log" sheet. The only columns that I am focused on are column B "TM" (Team Name) and column K "R" (Runs) I have a formula on the Game Log sheet in cells Y1:AF1 that will calculate wins and losses for everything in column B as I manually filter column B, and If the number in column K is 0, this is counted as a Win, if the number in column K is 1+ it is counted as a Loss.

    What I would love to do is have a formula in the Win-Loss Tracker sheet that can find the value of the corresponding team in column B of the Game Log Sheet and count how many cells are "0" in column K and how many cells are 1+ in column K of that game log sheet. and have this formula applied for each team in the win-loss tracker sheet.

    For example, the first team listed on the Win-Loss Tracker is "ARI" I would like to have a formula for D3 ("Wins") in the win-loss tracker sheet that will look for the name "ARI" in column B of the game log sheet and for those values, have it automatically calculate how many cells in column K have a "0" to count these as wins. Then for cell E3, it would do the exact same thing, however, it would automatically count any value 1 or higher in column K.

    The idea here is to have the data automatically update for each individual team instead of manually going through every filter and inputting by hand.

    Is this something that would be possible?
    Attached Files Attached Files

  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,863

    Re: Formula to Calculate Win/Loss Records from Sheet 1 to Sheet 2 After Filtering Data

    In X2:

    =SORT(FILTER(UNIQUE(B2:B10000),UNIQUE(B2:B10000)<>"",""),,1)

    In Z2 copied down:

    =SUMIF(B:B,X2,K:K)

    and so on.
    Attached Files Attached Files
    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
    Registered User
    Join Date
    07-27-2022
    Location
    Colorado, USA
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    32

    Re: Formula to Calculate Win/Loss Records from Sheet 1 to Sheet 2 After Filtering Data

    Thank you for the quick response, however, Z2 is showing a value of 56, but if it is sorting for the number of cells containing "0" in column K, it should equal 138. I would assume if I can get this formula figured out, I can apply the same one for any value in column K that is >=1 as well.

    This way it will automatically calculate the Wins (0) and Losses (1+) and these formulas can then be copied for each team.

    Thank you!

  4. #4
    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,863

    Re: Formula to Calculate Win/Loss Records from Sheet 1 to Sheet 2 After Filtering Data

    Just explain what the calculations should be based on column K and I can make a suggestion.

    You gave us NO mocked up expected results, so it was a guess.

  5. #5
    Registered User
    Join Date
    07-27-2022
    Location
    Colorado, USA
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    32

    Re: Formula to Calculate Win/Loss Records from Sheet 1 to Sheet 2 After Filtering Data

    There is a formula in Z1 for the wins and AB1 for the losses for reference. (for a win, K2:K50000=0 and for a loss, K2:K50000>=1)

    These are the results I am looking for, but with a way for it to automatically apply to the specific value in Column B vs calculating for a total count of every team name listed in column B.

    For "ARI" the formula would count all of the 0's in column K and this total would populate in cell Z2, and a similar formula counting everything above 0 would populate in cell AB2 as a loss.

    With the data that is in there, Z2 should be populating "138" and AB2 should be populating "32"

  6. #6
    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,863

    Re: Formula to Calculate Win/Loss Records from Sheet 1 to Sheet 2 After Filtering Data

    OK - I'll take another look later.

  7. #7
    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,863

    Re: Formula to Calculate Win/Loss Records from Sheet 1 to Sheet 2 After Filtering Data

    OK - so, for wins:

    =COUNTIFS(B:B,X2,K:K,0)

    and for losses:

    =COUNTIFS(B:B,X2,K:K,">="&1)
    Attached Files Attached Files
    Last edited by AliGW; 08-26-2022 at 02:40 AM.

  8. #8
    Registered User
    Join Date
    07-27-2022
    Location
    Colorado, USA
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    32

    Re: Formula to Calculate Win/Loss Records from Sheet 1 to Sheet 2 After Filtering Data

    Yes, that is perfect. Thank you so much! You are amazing!

  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,863

    Re: Formula to Calculate Win/Loss Records from Sheet 1 to Sheet 2 After Filtering Data

    Glad to have helped.

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

    Also, if you have not already done so, you may not be aware that you can thank those who have helped you by clicking the small star icon (* Add Reputation) 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 all those who offered help.

+ 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 Profit/Loss per Month, based on Data from another Sheet
    By ExcelLearner1111 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-03-2021, 11:06 PM
  2. Count unique records on 'raw data' sheet and display on 'result' sheet
    By NonEventHorizon in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-26-2021, 06:09 AM
  3. Macro filtering on main data sheet and creating new sheet with the results
    By will5will in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-17-2018, 11:43 AM
  4. Replies: 4
    Last Post: 10-16-2015, 12:59 PM
  5. Formula Issues - Filtering data to new sheet.
    By payne90 in forum Excel General
    Replies: 1
    Last Post: 03-17-2014, 05:48 AM
  6. Replies: 2
    Last Post: 12-20-2013, 01:09 PM
  7. Filtering records besed upon another sheet
    By hcnewhouse in forum Excel General
    Replies: 5
    Last Post: 02-28-2012, 07:28 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