+ Reply to Thread
Results 1 to 4 of 4

Formula, Macro, or Pivot to compile stats?

Hybrid View

  1. #1
    Registered User
    Join Date
    12-08-2010
    Location
    Forney TX USA
    MS-Off Ver
    Office 365
    Posts
    54

    Formula, Macro, or Pivot to compile stats?

    Not sure if I would use a formula, macro, or pivot table, or even another method of data collecting, but here's what I have:

    I keep baseball game statistics in a workbook and would like to calculate the number of consecutive games a player has a hit, dating from the most recent game date. (For those who follow baseball, I'm looking for the batter's current hitting streak.)

    I transfer each game's statistics ("box score") onto a cumulative list of games played by all teams (attached worksheet). I would like to add a column that depicts the player's current "hitting streak."

    The relative columns are A ("Player), C ("Game Dt"), F ("H") and T ("PA"). Would want to read up the data until the specified player has 0 in column F and column T is greater than 0.

    I already have a pivot table for the players' statistics, based on the data in this worksheet...just need to add the hitting streak data.

    Clear as mud? Suggestions?

    I could use Access, but I'm not as familiar with it and I love working with Excel.

    Thanks in advance!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    12-08-2010
    Location
    Forney TX USA
    MS-Off Ver
    Office 365
    Posts
    54

    Re: Formula, Macro, or Pivot to compile stats?

    Forgot to add that I use Excel 2017 from the Office 365.

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,720

    Re: Formula, Macro, or Pivot to compile stats?

    pskwaak find the attachment.

    If I have interpreted the stats headers and instructions correctly this seem to do what you want.

    This fails if is not sorted by player.

    In column W this formula determines if player got any hits.
    Formula: copy to clipboard
    =--ISNUMBER(1/SUM(I2:K2,F2))
    In column X this formula determines the MAX hitting streak for each player. It must be array entered. It takes time to calculate. If you are not aware of it array formulas are resource hungry. I don't know how many rows you have in the real data. It may be too slow. If there is an alternative method (formula wise) I have not thought of it yet.
    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    =MAX(FREQUENCY(IF(($A2=$A$2:$A$6702)*$W$2:$W$6702,ROW($A$2:$A$6702)),IF(NOT(($A2=$A$2:$A$6702)*$W$2:$W$6702),ROW($A$2:$A$6702))))


    You didn't request it but in Y1 find the maximum hitting streak. Across Z1:AC1 and AE1:AH1 find the beginning and ending dates and opponents.

    If was me I would go with a non-formula alternative.
    Attached Files Attached Files
    Dave

  4. #4
    Registered User
    Join Date
    12-08-2010
    Location
    Forney TX USA
    MS-Off Ver
    Office 365
    Posts
    54

    Re: Formula, Macro, or Pivot to compile stats?

    Thanks for the input. Unfortunately, re-sorting the player list after each transfer of data would be too time-consuming. I can see the same data from my pivot table, but am looking for a quick reference rather than have to pull each player up. The formulas did help me see other potential, so thanks for that. I agree that a macro, pivot table update, or other method is probably what I need. Hopefully, I'll have some other feedback to this.

+ 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. Graph to show individual Stats as compared to the population stats
    By Kellbells in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-12-2015, 10:36 AM
  2. Formula / Stats help!!!!!
    By avs in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-04-2014, 04:45 PM
  3. building a stats. from pivot table
    By ciapul12 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 01-10-2014, 08:11 AM
  4. [SOLVED] COmpile data from multiple sheets? for stats history?
    By Turtlejd in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-04-2013, 10:16 PM
  5. Replies: 2
    Last Post: 02-23-2012, 12:27 PM
  6. Pivot Table - NBA stats - Show last 5 games
    By davidskg in forum Excel General
    Replies: 10
    Last Post: 01-22-2012, 12:48 PM
  7. I need help with a formula for cricket stats!
    By mr green in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-23-2006, 09:51 PM

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