Solved

Calculating latest 10 results in excel 2003

Posted on 2011-03-15
8
255 Views
Last Modified: 2012-05-11
Hi there,

I'm having real difficulty finding a formula to calculate the last 10 results in a range of cells.
Say I have 10-1 in Cells A1-A10. So 10 in A1, 9 in A2 etc...
I want to find a formula which will calculates the average of these cells, but everyday someone inputs a new figure at the top of this set in A1 by inserting a new cell.
So lets say they add 11 to A1, the rest of the column will have 10 in A2, 9 in A3 etc... all the way to A11. Each day a new figure is added at the top, pushing the others downwards.
Is there a formula which will calculate only the A1 through to A10 averages?

Thanks, Screenshot attached to help visualise.

Doc1.doc
0
Comment
Question by:riverbank
8 Comments
 
LVL 8

Expert Comment

by:2toria
ID: 35136953
Yes, type this:-

=AVERAGE($A$1:$A$10)

And that should do it for you.   Is that what you meant?
Matt
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 250 total points
ID: 35136958
If you always want to average A1:A10 and don't want that to change when you insert cells then try using INDIRECT, i.e.

=AVERAGE(INDIRECT("a1:a10"))

regards, barry
0
 
LVL 18

Expert Comment

by:Raheman M. Abdul
ID: 35136964
VBA use function to calculate

Function Tryit()
Range("$B$1").Value = Application.WorksheetFunction.Average(Range("A1:A10"))
End Function
0
 
LVL 6

Expert Comment

by:akajohn
ID: 35137034
Two named ranges defined:

ListA
=OFFSET(INDIRECT("A1"),0,0,COUNTA(Sheet1!$A:$A),1)

and List10 (The last 10 values)
=OFFSET(ListA,ROWS(ListA)-10,0,10,1)

The sum of the last 10 numbers is the attached file is always 55 (Sum of the last 10 numbers, 1 to 10) no matter how many cells you insert in A1.

The sum you need is always

=SUM(List10)

Hope I understood this well. I tested on Excel 2003.

A>
Last10-aka.xls
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 6

Expert Comment

by:akajohn
ID: 35137135
Alternatively if you like complex formulas

The sum you need is

=SUM(OFFSET(OFFSET(INDIRECT("A1"),0,0,COUNTA(Sheet1!$A:$A),1),ROWS(OFFSET(INDIRECT("A1"),0,0,COUNTA(Sheet1!$A:$A),1))-10,0,10,1))

With a word of warning, inserting a blank cell spoils the result. However if you always have numbers in column A it works.

A>
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 35137170
Wouldn't my suggestion be a little simpler?  :)

regards, barry
0
 
LVL 6

Expert Comment

by:akajohn
ID: 35137191
That's correct Barry. riverbank - Please ignore my answer. I actually calculated the sum of last 10 entries, not the first 10 entries. Obviously Read it in a hurry. "latest" is bit different from "last"!

A>
0
 
LVL 1

Author Closing Comment

by:riverbank
ID: 35147095
Thanks Barryhoudini, that has worked a treat. Thank you akajohn also for your suggestions, however barry's solution worked so I didn't try yours.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now