average nonzero values within the last 30 entries

aaacccc

New Member
Joined
Jul 11, 2013
Messages
19
I want to average the last non zero values that fall within the last 30 entries. Entries will be added regularly.

I also want to know if there is a way to re-display the values of the last 30 rows in another table within the same sheet and if it can update automatically as new rows are added.


the equation I have is: but I do not how to change it. Right now it gives me the average of the last 30 non zero values of the column regardless of whether it lies in the last 30 entries.


=AVERAGE(IF(ROW(A1:A100)>=LARGE(IF(A1:A100,ROW(A1:A100)),30),IF(A1:A100,A1:A100)))
</pre>
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
maybe this:
=AVERAGE(IF(ROW(A1:A100)>=LARGE(ROW(A1:A100),30),IF(A1:A100,A1:A100)))

Ctrl+Shift+Enter to confirm.... this just takes out the IF function, which was used to look at the rows and consider them if they were non-zero..
 
Upvote 0

Forum statistics

Threads
1,215,854
Messages
6,127,342
Members
449,377
Latest member
CastorPollux

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