Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Averaging the Last Numbers in a Column.

Averaging the Last Numbers in a Column

by Allen Wyatt
(last updated August 3, 2015)


Emma has a list of numbers in a worksheet (let's say in column A) that are added to on a weekly basis. She needs to calculate the average of the last 12 numbers in the column. She wonders how she can do this and have the average always reflect the last 12 numbers, even when she keeps adding numbers each week.

Assuming that there are no gaps in your range of numbers, you can calculate the average of the last 12 numbers with this formula:


This formula should, of course, be placed in some cell that is not in column A. It uses the COUNTA function to figure out how many cells contain something in column A. If there are 100 cells in use in column A, this means that you end up with a formula being evaluated in this way:


Of course, 100 minus 12 is 88, and this number is used as an offset from the starting cell (A2) to say that the range to be averaged should start at A89 and extend down 12 cells. That means that the average ends up being for the range A89:A100. As more numbers are added at the bottom of column A, the formula always reflects the last 12 numbers.

The formula will return an error if column A has fewer than 12 rows worth of data in it. To accommodate that possibility, you may want to alter the formula just a bit:


Instead of using a hard-and-fast value of 12 rows, the MIN function (in two places) returns the minimum of either the actual number of rows or 12. So, if your worksheet only has numbers in cells A1:A5, the MIN function would ensure that the formula only averaged those 5 values.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10278) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Averaging the Last Numbers in a Column.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...


Selecting Fonts for a Chart

When formatting a chart, you might want to change the characteristics of the font used in various chart elements. This ...

Discover More

Moving the Taskbar to a Different Edge of the Screen

The Taskbar is normally displayed along the bottom edge of the screen. Windows gives you the flexibility to decide where ...

Discover More

Formatted Merging

When you use the mail-merge capabilities of Word, the information merged takes on the formatting of your source document, ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (ribbon)

Determining a Simple Moving Average

A moving average can be a great way to analyze a series of data points that you've collected over time. Setting up a ...

Discover More

Averaging Values for a Given Month and Year

Excel is often used to analyze data collected over time. In doing the analysis, you may want to only look at data ...

Discover More

Averaging a Non-Contiguous Range

Figuring out how to average data that is in a contiguous range of cells is easy. When the data is spread over a group of ...

Discover More

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.


If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 1 + 5?

2017-09-10 17:45:51


I have been trying to figure out how to apply the tip above to my situation.

I have a list of data that I enter sales each day. I have a column B that list the days of the week. Column I has the amount. I then get the average sales for Monday using this formula. I created one for each day of the week.

If I want to know the average sales for Mondays for only the last 8 Mondays, of the last 2 months of business, 60 days total, how would I adjust this formula to make it wok.

Thanks in advance.


2017-01-08 19:40:54

Peter Atherton


Try this




I don't quite understand the column B bit but here is a simple formula

Enter the date you want in G3 in B2 enter =G3-12

and the formula =AVERAGEIFS(C2:C232,A2:A232,">="&G2,A2:A232,"<="&G3)


2017-01-07 13:59:27

Vasant Bhanushali

if i want the average of 30 cells from a60 upwards. because i keep on adding 1 cell at A30 daily , the formula Average (A30:A60) changes to Average(A31:A61)

I want the formula to remain Average(A30:A60)

how do i do this

2016-10-29 02:59:09

Mike Daley

I am trying to find a formula to work out an average of the previous 12 weeks from any week. So I have a list of weeks with figures in column C and I want the previous 12 weeks average from any particular date, excluding any weeks where column B has a number in. When I exclude this value, I want the next previous week adding so the total averaged will always be 12 weeks. Does anybody have a formula to calculate this?

2016-08-11 11:43:13


This tip was exactly what I needed. Thank you for providing this formula.

2016-07-26 12:36:23

Michael (Micky) Avidan

Assuming the values are in the range A1:A100, try the following formula in cell A2:
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2017)

2016-07-25 09:31:54



how would I do the same as above but only for rows?(Horizontally)

2016-07-13 16:50:36

Saul Tave

I want to average the latest 3 entries in a horizontal line of cells, excluding any cells with no value in them. Example: a group of golfers record their "points" each week that they play to achieve the "average points" they are targeted to achieve next time they play, but they do not all play every week. I want to average the last 3 times each of them played. How can I do this?

2016-04-14 11:59:34


72 29/05/15 09:21 1,00

i want to calculate only last numbers "1,00". i have more than 8000 lines and i want to calculate.

2016-03-31 09:17:18

Michael (Micky) Avidan

Allen's suggested formula is correct.
Assuming you have 20 values in the range A1:A20.
* The part: COUNTA(A:A)-12 returns: 8
* If you move down 8 cells (starting at A1) you end in cell: A9
2) Offset 12 from A9 ends in: A9:A20 which are the last 12 cells in the column.
*** by the way - the [width] argument is optional and, in our case, can be avoided.
*** The Columns offset is: 0 therefore we can omit its typing between the two adjacent commas.
Here is the formula I would use:
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2016)

2016-03-30 18:06:33

Pete Hosking

Thanks Allen that was perfect. I needed this for SUM and that worked exactly the same. It was late in the day and my brain was a bit beyond working this out so many thanks.

2015-12-04 17:30:31


To add up the last 12 rows, shouldn't you only offset by 11 rows (-11) and then have the range be 12 rows? Like this? AVERAGE(OFFSET(A1,COUNTA(A:A)-11,0,12,1))

2015-10-11 17:05:13

Peter Atherton



The formula should have been:

2015-10-09 08:44:27

Peter Atherton



2015-10-06 14:26:52


This tip was very helpful, but I am having one problem. When you put in the 12, it sums the next twelve cells down and takes the average. In my spreadsheet, sometimes the next twelve cells contain a zero. Is there a formula to sum only the next twelve cells that are greater than zero and then take the average?

This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.