Help needed with index (offset) formula

G

Guest

Guest
I have a column with data in cells A1 down to A20 and with data being added each day to the bottom. I am trying to calculate the 'average of the last five cells' (so today it would be the average of A16:A20, whereas tomorrow it would be average of A17:A21). I know I need to use the index/offset formula but can't seem to get it right - can anyone help me from tearing my hair out!

Thanks
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
On 2002-03-14 04:39, Anonymous wrote:
I have a column with data in cells A1 down to A20 and with data being added each day to the bottom. I am trying to calculate the 'average of the last five cells' (so today it would be the average of A16:A20, whereas tomorrow it would be average of A17:A21). I know I need to use the index/offset formula but can't seem to get it right - can anyone help me from tearing my hair out!

Thanks

=AVERAGE(OFFSET($A$1,MATCH(9.99999999999999E+307,A:A)-5,0,5,1))

You can also put 5 in some cell, e.g., E1, and use:

=AVERAGE(OFFSET($A$1,MATCH(9.99999999999999E+307,A:A)-E1,0,E1,1))
 
Upvote 0
Hi

Provided Column A is dedicated solely to your list, with data starting in A1 and with no gaps, you can use these 2 formulas
Formula in B1 is:... ="A"&COUNTA(A:A)-4&":"&"A"&COUNTA(A:A)
Formula in C1 is:... =AVERAGE(INDIRECT(B1))

Hope this helps
regards
Derek
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,479
Members
448,967
Latest member
visheshkotha

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