Try one of these. Both formulas are array formulas and need to be entered
using the key combination of CTRL,SHIFT,ENTER (not just ENTER):
This one will average the last 4 entries in row 1 (A1:IV1). If there are not
at least 4 entries to average the formula returns an error:
=AVERAGE(IF(COLUMN(1:1)=LARGE(IF(1:1,COLUMN(1:1)) ,4),IF(1:1,1:1)))
This version will average the last 4 entries in row 1 (A1:IV1). If there are
not at least 4 entries to average the formula will average the last n
entries up to 4. If there are *no* numbers to average the formula returns an
error.
=AVERAGE(IF(COLUMN(1:1)=LARGE(IF(1:1,COLUMN(1:1)) ,MIN(COUNTIF(1:1,"0"),4)),IF(1:1,1:1)))
Biff
"
VB Coach" <
VB wrote in message
...
I am tracking weekly scores in a table and want to be able to calculate a
4-entry trailing average. Not every cell will have a value, so the last 4
entries might be spread over more than 4 cells in the row. For example,
tracking player point totals over a period of weeks, a player might be
sick
one week and thus not have points that week, so the cell would be blank
(as
opposed to zero).