Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Omkar
 
Posts: n/a
Default How to find avg for step size?

How to find avg for specific step size? I have annual data and want to find
weekly avg. i.e avg A1:A6 then A7:A14 etc.. How to do it using sigle formula?

Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max
 
Posts: n/a
Default How to find avg for step size?

"Omkar" wrote:
How to find avg for specific step size? I have annual data and want to find
weekly avg. i.e avg A1:A6 then A7:A14 etc.. How to do it using sigle formula?


One way ..

Source data is assumed in A1 down

Put in any starting cell, say in B2:
=AVERAGE(OFFSET(INDIRECT("A"&ROW(A1)*7-6),,,6))
Copy B2 down

B2 returns: =AVERAGE(A1:A6)
B3 returns: =AVERAGE(A7:A14)
and so on ..

--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max
 
Posts: n/a
Default How to find avg for step size?

"Omkar" wrote:
How to find avg for specific step size? I have annual data and want to find
weekly avg. i.e avg A1:A6 then A7:A14 etc.. How to do it using sigle formula?


One way ..

Source data is assumed in A1 down

Put in any starting cell, say in B2:
=AVERAGE(OFFSET(INDIRECT("A"&ROW(A1)*7-6),,,6))
Copy B2 down

B2 returns: =AVERAGE(A1:A6)
B3 returns: =AVERAGE(A7:A14)
and so on ..

--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max
 
Posts: n/a
Default How to find avg for step size?

Corrections, sorry:

Put in any starting cell, say in B2:
=AVERAGE(OFFSET(INDIRECT("A"&ROW(A1)*7-6),,,6))


The formula in B2 should be:
=AVERAGE(OFFSET(INDIRECT("A"&ROW(A1)*7-6),,,7))

and lines
B2 returns: =AVERAGE(A1:A6)
B3 returns: =AVERAGE(A7:A14)
and so on ..


should read as:
B2 returns: =AVERAGE(A1:A7)
B3 returns: =AVERAGE(A8:A14)
and so on ..

--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Omkar
 
Posts: n/a
Default How to find avg for step size?

Thank you Max.

I did as you said, but I am getting different answers. (I compared values
which I found from separating each data series of 7 points and finding their
avgs.)
Can you explain what is significance of each term. I know some. But you
have written nothing for Rows,Columns,Height for Offset function.
Also what is *7-6 signifies in reference?

Please try to help me.
Thank you for your help.


"Max" wrote:

Corrections, sorry:

Put in any starting cell, say in B2:
=AVERAGE(OFFSET(INDIRECT("A"&ROW(A1)*7-6),,,6))


The formula in B2 should be:
=AVERAGE(OFFSET(INDIRECT("A"&ROW(A1)*7-6),,,7))

and lines
B2 returns: =AVERAGE(A1:A6)
B3 returns: =AVERAGE(A7:A14)
and so on ..


should read as:
B2 returns: =AVERAGE(A1:A7)
B3 returns: =AVERAGE(A8:A14)
and so on ..

--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default How to find avg for step size?

Hi!

What is the starting cell of the range where your numbers are located? Is it
A1?

What step size do you want? In your post you have: A1:A6 then A7:A14 etc..

A1 to A6 = 6
A7 to A14 = 8

Biff

"Omkar" wrote in message
...
Thank you Max.

I did as you said, but I am getting different answers. (I compared values
which I found from separating each data series of 7 points and finding
their
avgs.)
Can you explain what is significance of each term. I know some. But you
have written nothing for Rows,Columns,Height for Offset function.
Also what is *7-6 signifies in reference?

Please try to help me.
Thank you for your help.


"Max" wrote:

Corrections, sorry:

Put in any starting cell, say in B2:
=AVERAGE(OFFSET(INDIRECT("A"&ROW(A1)*7-6),,,6))


The formula in B2 should be:
=AVERAGE(OFFSET(INDIRECT("A"&ROW(A1)*7-6),,,7))

and lines
B2 returns: =AVERAGE(A1:A6)
B3 returns: =AVERAGE(A7:A14)
and so on ..


should read as:
B2 returns: =AVERAGE(A1:A7)
B3 returns: =AVERAGE(A8:A14)
and so on ..

--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max
 
Posts: n/a
Default How to find avg for step size?

"Omkar" wrote:
I did as you said, but I am getting different answers. (I compared values
which I found from separating each data series of 7 points and finding their
avgs.)


I'm not sure what happened over there,
but here's a sample implementation to illustrate ..
http://www.savefile.com/files/6466382
Averaging 7 cell column ranges.xls

Btw, I had presumed there were some typos in your original post's range refs:
.. weekly avg. i.e avg A1:A6 then A7:A14 ..

I focused more on your "weekly avg" and presumed it should have read as:
avg A1:A7 then A8:A14 ..

Can you explain what is significance of each term. I know some. But you
have written nothing for Rows,Columns,Height for Offset function.
Also what is *7-6 signifies in reference?


Some explanations ..

In the expression: OFFSET(INDIRECT("A"&ROW(A1)*7-6),,,7)

ROW(A1) is used as the serial incrementer when we copy down
In any cell, =ROW(A1) resolves to 1, when copied down, it becomes ROW(A2)
which returns 2, then ROW(A3) which returns 3 and so on..

The *7-6 is an arithmetic op applied so that we can get the desired series:
1, 8, 15, ... (steps of 7 cells), viz.:

ROW(A1)*7-6 resolves to: 1 x 7 - 6 = 1
ROW(A2)*7-6 gives: 2 x 7 - 6 = 8
ROW(A3)*7-6 returns: 3 x 7 - 6 = 15
and so on, as the formula is copied down
(see the above results by putting in any cell: =ROW(A1)*7-6, then copy down)

The numbers 1, 8, 15 are then concatenated with "A" to yield the text string
cell refs: A1, A8, A15 which represent the desired start points for the
ranges:

A1:A7
A8:A14
A15:A22

INDIRECT resolves the text string cell refs to give the OFFSET references,
viz.:

OFFSET(A1,,,7)
OFFSET(A8,,,7)
OFFSET(A15,,,7)

The "7" is the height param in OFFSET which grabs a 7 cell col range from
the OFFSET reference, hence the 3 OFFSETs above would effectively return the
ranges:

A1:A7
A8:A14
A15:A22

for the AVERAGE( ... ) function to evaluate
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max
 
Posts: n/a
Default How to find avg for step size?

Typo, lines: A15:A22
should read as: A15:A21

--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
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
find Mindy Excel Worksheet Functions 2 May 26th 06 06:19 PM
Find Function Guy Lydig Excel Discussion (Misc queries) 2 May 19th 06 07:19 PM
chart size zdenek Charts and Charting in Excel 0 February 9th 06 09:58 AM
My tabs' font size is smaller - how do I restore default size? katykins53 Excel Discussion (Misc queries) 1 January 11th 06 12:07 AM
Font size prints same size regardless of how I set it in Excel Marcusmouse Excel Discussion (Misc queries) 2 May 26th 05 03:25 PM


All times are GMT +1. The time now is 07:27 AM.

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

About Us

"It's about Microsoft Excel"