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
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:
And now, when you input new numbers behind the original data, the average will be changed as well, see screenshot:
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:
Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
More than 300 powerful features. Supports Office/Excel
2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features
30-day free trial. 60-day money back guarantee.