calculating moving average

G

Guest

would like to ba able to calculate the last 3 entries of any given row. how
ever the data(score) may not be in the last three colums. EG. Four columns
A:D and Three rows 1:3

A B C D (Average)

1- 2 3 4 3

2- 2 2 2 2

3- 3 6 3 3 4
 
J

Jerry W. Lewis

=AVERAGE(IF(ISNUMBER(A1:D1)*(COLUMN(A1:D1)>=LARGE(IF(ISNUMBER(A1:D1),COLUMN(A1:D1)),3)),A1:D1))

Array entered (ctrl-shift-enter)

Jerry
 
J

Jason Morin

One way, array-entered:

=AVERAGE(OFFSET(A1,,MATCH(9.99999999999999E+307,1:1)-1,,-
1+LARGE(IF(1:1<>"",COLUMN(1:1)),3)-MATCH
(9.99999999999999E+307,1:1)))

The above example is for row 1. Modify accordingly.

HTH
Jason
Atlanta, GA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top