Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
keving
 
Posts: n/a
Default calculating averages

I am sure there is a simple way!
each week I insert a number in a column, thus after 6 weeks I have A1:A6
filled in. Each week I need to take the average of the last 4 numbers. How
can I calculate this automatically without having to change the range each
time?
from Kevin
  #2   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

One way


=AVERAGE(INDEX(A:A,MATCH(9.99999999999999E+307,A:A )-3):INDEX(A:A,MATCH(9.99999999999999E+307,A:A)))



Regards,

Peo Sjoblom


"keving" wrote:

I am sure there is a simple way!
each week I insert a number in a column, thus after 6 weeks I have A1:A6
filled in. Each week I need to take the average of the last 4 numbers. How
can I calculate this automatically without having to change the range each
time?
from Kevin

  #3   Report Post  
Bernard Liengme
 
Posts: n/a
Default

I think it can be done more elegantly but this works
=AVERAGE(OFFSET(A1:A1,COUNT(A1:A5000)-6,0):OFFSET(A1:A1,COUNT(A1:A5000)-1,0))

I am assuming you will not go passed A5000

best wishes

--
Bernard Liengme
www.stfx.ca/people/bliengme
remove CAPS in email address


"keving" wrote in message
...
I am sure there is a simple way!
each week I insert a number in a column, thus after 6 weeks I have A1:A6
filled in. Each week I need to take the average of the last 4 numbers. How
can I calculate this automatically without having to change the range each
time?
from Kevin



  #4   Report Post  
Bernard Liengme
 
Posts: n/a
Default

Misread question, I averaged last 6. Change that to
=AVERAGE(OFFSET(A1:A1,COUNT(A1:A5000)-4,0):OFFSET(A1:A1,COUNT(A1:A5000)-1,0))
to average last 4

--
Bernard Liengme
www.stfx.ca/people/bliengme
remove CAPS in email address


"Bernard Liengme" wrote in message
...
I think it can be done more elegantly but this works
=AVERAGE(OFFSET(A1:A1,COUNT(A1:A5000)-6,0):OFFSET(A1:A1,COUNT(A1:A5000)-1,0))

I am assuming you will not go passed A5000

best wishes

--
Bernard Liengme
www.stfx.ca/people/bliengme
remove CAPS in email address


"keving" wrote in message
...
I am sure there is a simple way!
each week I insert a number in a column, thus after 6 weeks I have A1:A6
filled in. Each week I need to take the average of the last 4 numbers.
How
can I calculate this automatically without having to change the range
each
time?
from Kevin





  #5   Report Post  
keving
 
Posts: n/a
Default

oh my! it seems complicated.
the table below shows what I need to do, assuming there is just one column
and I add to it each week.Thus, wk8 I average numbers from B5:B8
A B A B
1 wk1 2 wk1 2
2 wk2 3 wk2 3
3 wk3 4 wk3 4
4 wk4 3 wk4 3
5 wk5 2 wk5 2
6 wk6 1 wk6 1
7 wk7 4


AVERAGE(B3:B6) AVERAGE(B4:B7)


"Bernard Liengme" wrote:

I think it can be done more elegantly but this works
=AVERAGE(OFFSET(A1:A1,COUNT(A1:A5000)-6,0):OFFSET(A1:A1,COUNT(A1:A5000)-1,0))

I am assuming you will not go passed A5000

best wishes

--
Bernard Liengme
www.stfx.ca/people/bliengme
remove CAPS in email address


"keving" wrote in message
...
I am sure there is a simple way!
each week I insert a number in a column, thus after 6 weeks I have A1:A6
filled in. Each week I need to take the average of the last 4 numbers. How
can I calculate this automatically without having to change the range each
time?
from Kevin






  #6   Report Post  
Bernard Liengme
 
Posts: n/a
Default

Have you tried either of the answers sent to you?

--
Bernard Liengme
www.stfx.ca/people/bliengme
remove CAPS in email address


"keving" wrote in message
...
oh my! it seems complicated.
the table below shows what I need to do, assuming there is just one column
and I add to it each week.Thus, wk8 I average numbers from B5:B8
A B A B
1 wk1 2 wk1 2
2 wk2 3 wk2 3
3 wk3 4 wk3 4
4 wk4 3 wk4 3
5 wk5 2 wk5 2
6 wk6 1 wk6 1
7 wk7 4


AVERAGE(B3:B6) AVERAGE(B4:B7)


"Bernard Liengme" wrote:

I think it can be done more elegantly but this works
=AVERAGE(OFFSET(A1:A1,COUNT(A1:A5000)-6,0):OFFSET(A1:A1,COUNT(A1:A5000)-1,0))

I am assuming you will not go passed A5000

best wishes

--
Bernard Liengme
www.stfx.ca/people/bliengme
remove CAPS in email address


"keving" wrote in message
...
I am sure there is a simple way!
each week I insert a number in a column, thus after 6 weeks I have
A1:A6
filled in. Each week I need to take the average of the last 4 numbers.
How
can I calculate this automatically without having to change the range
each
time?
from Kevin






  #7   Report Post  
keving
 
Posts: n/a
Default

Thank you for the advice. I will give the solutions a go!

"Bernard Liengme" wrote:

Misread question, I averaged last 6. Change that to
=AVERAGE(OFFSET(A1:A1,COUNT(A1:A5000)-4,0):OFFSET(A1:A1,COUNT(A1:A5000)-1,0))
to average last 4

--
Bernard Liengme
www.stfx.ca/people/bliengme
remove CAPS in email address


"Bernard Liengme" wrote in message
...
I think it can be done more elegantly but this works
=AVERAGE(OFFSET(A1:A1,COUNT(A1:A5000)-6,0):OFFSET(A1:A1,COUNT(A1:A5000)-1,0))

I am assuming you will not go passed A5000

best wishes

--
Bernard Liengme
www.stfx.ca/people/bliengme
remove CAPS in email address


"keving" wrote in message
...
I am sure there is a simple way!
each week I insert a number in a column, thus after 6 weeks I have A1:A6
filled in. Each week I need to take the average of the last 4 numbers.
How
can I calculate this automatically without having to change the range
each
time?
from Kevin






  #8   Report Post  
keving
 
Posts: n/a
Default

Bernard, I tried your solution - thank you it seems to work, but I have to
admit to not understanding the logic that well!
Any ideas where I might find an explanation of the formula?

"Bernard Liengme" wrote:

Misread question, I averaged last 6. Change that to
=AVERAGE(OFFSET(A1:A1,COUNT(A1:A5000)-4,0):OFFSET(A1:A1,COUNT(A1:A5000)-1,0))
to average last 4

--
Bernard Liengme
www.stfx.ca/people/bliengme
remove CAPS in email address


"Bernard Liengme" wrote in message
...
I think it can be done more elegantly but this works
=AVERAGE(OFFSET(A1:A1,COUNT(A1:A5000)-6,0):OFFSET(A1:A1,COUNT(A1:A5000)-1,0))

I am assuming you will not go passed A5000

best wishes

--
Bernard Liengme
www.stfx.ca/people/bliengme
remove CAPS in email address


"keving" wrote in message
...
I am sure there is a simple way!
each week I insert a number in a column, thus after 6 weeks I have A1:A6
filled in. Each week I need to take the average of the last 4 numbers.
How
can I calculate this automatically without having to change the range
each
time?
from Kevin






  #9   Report Post  
CLR
 
Posts: n/a
Default

Try this.........

In C4 put this formula and copy it down column C

=AVERAGE(B1:B4)

Vaya con Dios,
Chuck, CABGx3



"keving" wrote in message
...
I am sure there is a simple way!
each week I insert a number in a column, thus after 6 weeks I have A1:A6
filled in. Each week I need to take the average of the last 4 numbers. How
can I calculate this automatically without having to change the range each
time?
from Kevin



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formulas not calculating??? J Dizzle Fizzle Excel Discussion (Misc queries) 1 December 31st 04 07:47 PM
CALCULATING CELLS AS A TOTAL EDDIE Excel Discussion (Misc queries) 4 December 23rd 04 03:27 PM
Calculating effective time from start/end date+time Stefan Stridh Excel Worksheet Functions 8 November 27th 04 03:50 PM
excel template for calculating trial balances and adjusting entri. yesterdaytoday11 Excel Worksheet Functions 2 November 24th 04 06:25 PM
Calculating Net Position and Average Price carl Excel Worksheet Functions 6 October 31st 04 01:08 PM


All times are GMT +1. The time now is 06:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"