Excel Excel - How to select the last x entries in a column?

Joined
Apr 9, 2006
Messages
2
Reaction score
0
Can anyone help with this. I need to be able to select the last 12 (variable) entries in a column in an Excel worksheet. These entries need to be totalled and the average then worked out. Any ideas?

Thanks,

David
 

Rush

Cool Cruncher
Joined
Nov 3, 2005
Messages
4,129
Reaction score
9
If its just a simple formula then just insert =average(b4:b15) into a cell in column d2 , b4:b15 just hold the data you need to average ,this automatically adds then averages the data range ?? does this help ??
 

Attachments

  • Doc4.doc
    72 KB · Views: 191

daveydoom

Trusted Advisor
Joined
Oct 8, 2005
Messages
115
Reaction score
0
Rush's formula would have to be entered manually if the range isn't always the same (ie column A has 32 entries, column B has 49 entries, column C has 101 entries etc.).

To have a macro do it automatically the first thing you would have to do is find the last populated cell in each column. After that you would have to count backwards to add the contents of the last twelve cells and then average them. The code could then be copied so that the macro would do that for every column that has data in it.

I'm sorry I don't know the code to do it, I just know it can be done and that's one way to do it :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top