Averaging last 5 values having issues with blank cells

joeblow7

New Member
Joined
Jun 27, 2017
Messages
33
Office Version
  1. 365
I created a new score tracker for my golf league, but I'm having issue with it calculating the new averages after the 2nd week got rained out. The image below is where it will track each players round and take the average from. We use a 5 week rolling average. I have the average being calculated with :

=IF(COUNT('Players and Scores'!B3:AA3)>=5,AVERAGE(OFFSET('Players and Scores'!B3,0,COUNT('Players and Scores'!3:3)-5,1,5)), AVERAGE('Players and Scores'!B3:AA3))-36

It was working well, but now that there is an empty column the averages are incorrect. If I delete that week, it goes back to calculating averages correctly, but that really isn't viable as then future weeks don't line up with where they are expected to be.

scores.PNG
 
I get 7.8 with that formula
++Fluff.xlsm
ABCDEFGHI
1
2
3a50494242454842
4
57.8
6
Data
Cell Formulas
RangeFormula
B5B5=LET(f,FILTER(B3:AA3,B3:AA3<>""),AVERAGE(INDEX(f,SEQUENCE(,5,COLUMNS(f),-1)))-36)


Are those cells hard values, or formulae?
 
Upvote 0

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Realized I had a column of 0 while testing something else and that was affecting the results. It does seem though that it is working, but only if they have at least 5 rounds played. If they have less than it gives an answer of #VALUE!
 
Upvote 0
That's because the columns you said were blank aren't. They contain a 0.
Should all zeros be ignored?
 
Upvote 0
No that was a mistake on my end I just forgot to remove it. I added the if statement back in for if less than 5 scores and it looks like it is working correctly now. Thanks for your help.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,191
Members
452,616
Latest member
intern444

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