I have several columns and at the end of the column I need to average the last 30 non zero values. So far I have this:
=SUM(OFFSET(D16,COUNTA(D16:D326)-29,0,30,1))
column starts at D16 and ends D326
it seems to be working, but it automatically selects the last 30 entries regardless of the value, there are many cells that are empty and so I made them zero. I want an average of the last 30 values that are not zero. I will be adding rows to the column and so I want the formula to update as I add more entries.
I do not know much about excel, and keep reading online about arrays and codes, the simplest way would be best, thanks!
ex:
D
.
.
.
16
.
.
.
326
Average here
=SUM(OFFSET(D16,COUNTA(D16:D326)-29,0,30,1))
column starts at D16 and ends D326
it seems to be working, but it automatically selects the last 30 entries regardless of the value, there are many cells that are empty and so I made them zero. I want an average of the last 30 values that are not zero. I will be adding rows to the column and so I want the formula to update as I add more entries.
I do not know much about excel, and keep reading online about arrays and codes, the simplest way would be best, thanks!
ex:
D
.
.
.
16
.
.
.
326
Average here