#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 358
Default repeating function q

I posted this yesterday but when I pasted everyones versions of their formula
nothing worked. Here is what I have tried:
=AVERAGE(OFFSET($B$1,24*(ROW()-1),0,24,1)). If I want 24 rows in a column
do what do I put in the ROW ( ) parens. Is this right? See below for
explanation of issue




I have a column of data where I need to select a group of X number of cells
each time and obtain an average. When I copy the formula down it only copies
the formula with one additional space down, but I want it to jump over the
cells that have already been averaged. Example formuala is: Average(B1:B5),
when copied down it goes (B2:B6), but I want (B6:10). Im sure this is easy
but I dont know the shortcut.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 793
Default repeating function q

Assuming you want your averages in column B then
1. Enter your normal average formual in B1
1. Enter 24 in G1
2. put this in B2
=AVERAGE(OFFSET(INDIRECT("A"&($G$1*(ROW()-1))),$G$1,0,1,1))

and copy down.

"Andrew" wrote:

I posted this yesterday but when I pasted everyones versions of their formula
nothing worked. Here is what I have tried:
=AVERAGE(OFFSET($B$1,24*(ROW()-1),0,24,1)). If I want 24 rows in a column
do what do I put in the ROW ( ) parens. Is this right? See below for
explanation of issue




I have a column of data where I need to select a group of X number of cells
each time and obtain an average. When I copy the formula down it only copies
the formula with one additional space down, but I want it to jump over the
cells that have already been averaged. Example formuala is: Average(B1:B5),
when copied down it goes (B2:B6), but I want (B6:10). Im sure this is easy
but I dont know the shortcut.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 915
Default repeating function q

Andrew wrote:
I posted this yesterday but when I pasted everyones versions of their formula
nothing worked. Here is what I have tried:
=AVERAGE(OFFSET($B$1,24*(ROW()-1),0,24,1)). If I want 24 rows in a column
do what do I put in the ROW ( ) parens. Is this right? See below for
explanation of issue


Nothing goes in the row() parens. ROW() returns the row number where the
formula is pasted.

So in C1, the formula would evaluate as

=AVERAGE(OFFSET($B$1,24*(1-1),0,24,1))
=AVERAGE(OFFSET($B$1,0,0,24,1))
=AVERAGE(B1:B24)

In C2 it would evaluate like so:
=AVERAGE(OFFSET($B$1,24*(2-1),0,24,1))
=AVERAGE(OFFSET($B$1,24,0,24,1))
=AVERAGE(B25:B49)

What we're doing is moving the reference for the average by 24 rows from
B1 each time, starting with 0 offset (24*row()-1). The 2nd "24" in the
formula says how "high" the range should be, i.e., 24 rows.

Take a look at the OFFSET function in Help for a bit more explanation.

[snipped]
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
repeating function q Andrew Excel Discussion (Misc queries) 5 September 5th 08 01:58 AM
Repeating Above Value Roger J Michaud Excel Worksheet Functions 3 December 13th 06 02:37 PM
Repeating a concatenate function Topher Excel Worksheet Functions 5 August 17th 06 08:36 PM
repeating formulas sunrock Excel Discussion (Misc queries) 1 February 21st 06 06:39 PM
Repeating Lynn Excel Worksheet Functions 2 January 7th 05 04:25 PM


All times are GMT +1. The time now is 07:57 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"