Average of Last 5 values from cells with a formula

roju23

New Member
Joined
Nov 2, 2017
Messages
1
I have a spreadsheet with loads of data for fantasy basketball. I want to be able to calculate the average of the last 5 games of a player's fantasy scores. My column that records the scores is based on a formula drawing data from other cells and creating an aggregate score. So the points, rebounds, assists, etc calculate to a total. Thus in the column in question, there is a formula to calculate this score. I have found some info on how to get the last 5 values, but it does not work because there are blank cells (by design in the cell formula) and I get a DIV/#0 error. When I delete the cell contents for cells designated for unplayed games, the average formula works just fine. I'm looking for a workaround to get through this.

=AVERAGE(OFFSET(AQ2,COUNTA(AQ2:AQ83)-MIN(COUNTA(AQ2:AQ83),5),0,MIN(COUNTA(AQ2:AQ83),5),1))

This is the formula I found and I need help adapting it for my needs.

The cell formula for the game scores:

=if(AF78=" ", " ", AC78+(O78*0.5)+(W78*1.25)+(X78*1.5)+(Y78*2)+(Z78*2)-(AA78*0.5)+AO78+AP78)

I forced a blank to not have a 0 returned in the cell.

Any help is greatly appreciated.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Hi
Welcome to the board

Try:

=AVERAGE(INDEX($AQ:$AQ;AGGREGATE(14;6;ROW($AQ$2:$AQ$100)/ISNUMBER($AQ$2:$AQ$100);5)):$AQ$100)
 
Upvote 0

Forum statistics

Threads
1,216,027
Messages
6,128,367
Members
449,444
Latest member
abitrandom82

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top