Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to average last 5 values of a column as new numbers entering?

In Excel, you can quickly calculate the average of last 5 values in a column with the Average function, but, from time to time, you need to enter new numbers behind your original data, and you want the average result will be changed automatically as the new data entering. That is to say, you would like to have the average always reflect the last 5 numbers of your data list, even when you add numbers now and then.

Average last 5 values of a column as new numbers entering with formulas


arrow blue right bubble Average last 5 values of a column as new numbers entering with formulas


The following array formulas may help you to solve this problem, please do as follows:

Enter this formula into a blank cell:

=IF(COUNT(A:A),AVERAGE(INDEX(A:A,LARGE(IF(ISNUMBER(A1:A10000),ROW(A1:A10000)),MIN(5,COUNT(A1:A10000)))):A10000),"no data") (A:A is the column which contains the data you used, A1:A10000 is a dynamic range, you can expand it as long as your need, and the number 5 indicates the last n value.), and then press Ctrl + Shift + Enter keys together to get the average of last 5 numbers. See screenshot:

doc-average-last-5-1

And now, when you input new numbers behind the original data, the average will be changed as well, see screenshot:

doc-average-last-5-2

Note: If the column of cells contain 0 values, you want to exclude the 0 values from your last 5 numbers, the above formula will not work, here, I can introduce you another array formula to get the average of last 5 non-zero values, please enter this formula:

=AVERAGE(SUBTOTAL(9,OFFSET(A1:A10000,LARGE(IF(A1:A10000>0,ROW(A1:A10000)-MIN(ROW(A1:A10000))),ROW(INDIRECT("1:5"))),0,1))), and then press Ctrl + Shift + Enter keys to get the result you need, see screenshot:

doc-average-last-5-3


Related articles:

How to average every 5 rows or columns in Excel?

How to average top or bottom 3 values in Excel?



Recommended Productivity Tools for Excel

Kutools for Excel Helps You Always Finish Work Ahead of Time, and Stand Out From Crowd

  • More than 300 powerful advanced features, designed for 1500 work scenarios, increasing productivity by 70%, give you more time to take care of family and enjoy life.
  • No longer need memorizing formulas and VBA codes, give your brain a rest from now on.
  • Become an Excel expert in 3 minutes, Complicated and repeated operations can be done in seconds, 
  • Reduce thousands of keyboard & mouse operations every day, say goodbye to occupational diseases now.
  • 110,000 highly effective people and 300+ world-renowned companies' choice.
  • 60-day full features free trial. 60-day money back guarantees. 2 years of free upgrade and support.

Brings Tabbed Browsing and Editing to Microsoft Office, Far More Powerful Than The Browser's Tabs

  • Office Tab is designed for Word, Excel, PowerPoint and Other Office Applications: Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!

 

Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.