+ Reply to Thread
Results 1 to 6 of 6

Baseball Results: H/G when Games<30 & AB/G when Games<10

  1. #1
    Registered User
    Join Date
    04-09-2017
    Location
    Gilbert, AZ
    MS-Off Ver
    365 (Subscription)
    Posts
    20

    Baseball Results: H/G when Games<30 & AB/G when Games<10

    The previous formulas (from this thread: https://www.excelforum.com/excel-for...mic-stats.html) work perfectly for calculating only the last "n" number of games as specified. Now, I'm looking to calculate it when those minimums are not met. I know it's right there in front of me, but for some reason I can't see it. I'm looking for a formula that will do the following:
    • Column I: Calculate Avg Hits/Game ONLY when Games Played < 30 (and output "n >= minG" when Games Played >= 30)
    • Column J: Calculate Avg ABs/Game ONLY when Games Played < 10 (and output "n >= minG" when Games Played >= 10)

    I have attached a sample of my data and the output I'm looking for highlighted in yellow. Thank you again!!!

    Best regards,
    Eric
    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,830

    Re: Baseball Results: H/G when Games<30 & AB/G when Games<10

    Actually, it was more simple than I had anticipated!

    =IF(COUNTIF('B - Log'!E:E,'B - Stats'!C2)>=30,"n < minG",AVERAGEIFS('B - Log'!P:P,'B - Log'!E:E,'B - Stats'!C2,'B - Log'!B:B,">"&MAXIFS('B - Log'!B:B,'B - Log'!E:E,'B - Stats'!C2)-30))

    and

    =IF(COUNTIF('B - Log'!E:E,'B - Stats'!C2)>=10,"n < minG",AVERAGEIFS('B - Log'!N:N,'B - Log'!E:E,'B - Stats'!C2,'B - Log'!B:B,">"&MAXIFS('B - Log'!B:B,'B - Log'!E:E,'B - Stats'!C2)-10))

    seem to do what you want.
    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
    04-09-2017
    Location
    Gilbert, AZ
    MS-Off Ver
    365 (Subscription)
    Posts
    20

    Re: Baseball Results: H/G when Games<30 & AB/G when Games<10

    Quote Originally Posted by AliGW View Post
    Actually, it was more simple than I had anticipated!

    =IF(COUNTIF('B - Log'!E:E,'B - Stats'!C2)>=30,"n < minG",AVERAGEIFS('B - Log'!P:P,'B - Log'!E:E,'B - Stats'!C2,'B - Log'!B:B,">"&MAXIFS('B - Log'!B:B,'B - Log'!E:E,'B - Stats'!C2)-30))

    and

    =IF(COUNTIF('B - Log'!E:E,'B - Stats'!C2)>=10,"n < minG",AVERAGEIFS('B - Log'!N:N,'B - Log'!E:E,'B - Stats'!C2,'B - Log'!B:B,">"&MAXIFS('B - Log'!B:B,'B - Log'!E:E,'B - Stats'!C2)-10))

    seem to do what you want.
    You're kidding me, right? That's literally the exact same formula with the first criteria adjusted for my request. I knew it was right there in front of me.

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

    Re: Baseball Results: H/G when Games<30 & AB/G when Games<10

    Yup! Not enough coffee yet this morning foe me ...

  5. #5
    Registered User
    Join Date
    04-09-2017
    Location
    Gilbert, AZ
    MS-Off Ver
    365 (Subscription)
    Posts
    20

    Re: Baseball Results: H/G when Games<30 & AB/G when Games<10

    Quote Originally Posted by AliGW View Post
    Yup! Not enough coffee yet this morning foe me ...
    Begrudgingly, SOLVED. Apparently it's too late in the day for me. Thank you.

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

    Re: Baseball Results: H/G when Games<30 & AB/G when Games<10

    LOL! You're welcome (again)!

+ 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. Games Behind Formula
    By Milomet in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-24-2020, 03:24 PM
  2. Replies: 4
    Last Post: 03-31-2016, 11:43 PM
  3. Replies: 0
    Last Post: 08-09-2012, 07:56 PM
  4. DOS Games in Excel
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-25-2009, 07:29 AM
  5. Excel Games..who has them
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-05-2007, 08:11 AM

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