Averaging Values that Correspond with the X Largest Values in a Dynamic Range

 

Problem:

Column A contains dates of recent basketball games.
Column B contains the number of points scored by a particular player during each game.
Whenever a new game is played, the relevant dates and scores are added to the sheet.
We want to create formulas that will average the most recent X number of scores for each value for X listed in column D. The formulas should automatically update whenever new data is added.

Solution:

Use the AVERAGE, IF, and LARGE functions in the following Array formula:
{=AVERAGE(IF($A$2:$A$65000>=LARGE($A$2:$A$65000,D2),$B$2:$B$65000))}



Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>