Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How to average every 48 rows of data for 20,000 rows?

Hi. I have a huge spreadsheet (~20,000 rows). I need to average every 48 rows
into one value. Is there a quick and easy way to do this without scrolling
through all 20,000 rows and copy-pasting the "average" function every 48th
row?

Thank you.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 168
Default How to average every 48 rows of data for 20,000 rows?

Here's one way.

Let's say your data is in A1:F20000. Click in cell G1 and type this
formula

=IF(MOD(ROW(),48)=0,"YES","NO")

Copy column G and paste values. Now column G has "YES" every 48th
row. In column H put

=IF(G1="YES",AVERAGE(A1:G1),"")

Again, copy and paste values if you want the hard-coded data to stick.


HTH,
JP

On Nov 16, 4:52 pm, akoskelo
wrote:
Hi. I have a huge spreadsheet (~20,000 rows). I need to average every 48 rows
into one value. Is there a quick and easy way to do this without scrolling
through all 20,000 rows and copy-pasting the "average" function every 48th
row?

Thank you.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 168
Default How to average every 48 rows of data for 20,000 rows?

Forgot to mention that you should FILL DOWN the formula in columns G &
H before pasting in values.



On Nov 16, 5:11 pm, JP wrote:
Here's one way.

Let's say your data is in A1:F20000. Click in cell G1 and type this
formula

=IF(MOD(ROW(),48)=0,"YES","NO")

Copy column G and paste values. Now column G has "YES" every 48th
row. In column H put

=IF(G1="YES",AVERAGE(A1:G1),"")

Again, copy and paste values if you want the hard-coded data to stick.

HTH,
JP

On Nov 16, 4:52 pm, akoskelo
wrote:



Hi. I have a huge spreadsheet (~20,000 rows). I need to average every 48 rows
into one value. Is there a quick and easy way to do this without scrolling
through all 20,000 rows and copy-pasting the "average" function every 48th
row?


Thank you.- Hide quoted text -


- Show quoted text -


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 347
Default How to average every 48 rows of data for 20,000 rows?

Hi,

Try something like this array formula:

=AVERAGE(IF(MOD(A1:A20000,48)=1,A1:A20000))
adjust to suit.... the 1 represents the row of your first data cell to
average, so if your data starts on row 3 then change the 1 to a 3, also this
is an array formula so commit with Ctrl+Shift+Enter

HTH
Jean-Guy


"akoskelo" wrote:

Hi. I have a huge spreadsheet (~20,000 rows). I need to average every 48 rows
into one value. Is there a quick and easy way to do this without scrolling
through all 20,000 rows and copy-pasting the "average" function every 48th
row?

Thank you.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 168
Default How to average every 48 rows of data for 20,000 rows?

....and I just realized you can combine the formulas.

=IF(MOD(ROW(),48)=0,AVERAGE(A1:F1),"")


:-)


HTH,
JP

On Nov 16, 5:17 pm, JP wrote:
Forgot to mention that you should FILL DOWN the formula in columns G &
H before pasting in values.

On Nov 16, 5:11 pm, JP wrote:



Here's one way.


Let's say your data is in A1:F20000. Click in cell G1 and type this
formula


=IF(MOD(ROW(),48)=0,"YES","NO")


Copy column G and paste values. Now column G has "YES" every 48th
row. In column H put


=IF(G1="YES",AVERAGE(A1:G1),"")


Again, copy and paste values if you want the hard-coded data to stick.


HTH,
JP


On Nov 16, 4:52 pm, akoskelo
wrote:


Hi. I have a huge spreadsheet (~20,000 rows). I need to average every 48 rows
into one value. Is there a quick and easy way to do this without scrolling
through all 20,000 rows and copy-pasting the "average" function every 48th
row?


Thank you.- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 347
Default How to average every 48 rows of data for 20,000 rows?

Hi,

Just a small adjustment to my previous formula:

=AVERAGE(IF(MOD(ROW(A1:A20000),48)=1,A1:A20000))
commit using Ctrl+Shift+Enter

Hope this helps!
Jean-Guy

"akoskelo" wrote:

Hi. I have a huge spreadsheet (~20,000 rows). I need to average every 48 rows
into one value. Is there a quick and easy way to do this without scrolling
through all 20,000 rows and copy-pasting the "average" function every 48th
row?

Thank you.

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 347
Default How to average every 48 rows of data for 20,000 rows?

Hi,

If you have more that one column to average then just adapt it this way:

=AVERAGE(IF((A1:B200000)*(MOD(ROW(A1:B20000),48)= 1),A1:B20000))
if you need to average the "0" values as well then just remove that part of
the formula....again commit using Ctrl+Shift+Enter

HTH
Jean-Guy

"akoskelo" wrote:

Hi. I have a huge spreadsheet (~20,000 rows). I need to average every 48 rows
into one value. Is there a quick and easy way to do this without scrolling
through all 20,000 rows and copy-pasting the "average" function every 48th
row?

Thank you.

  #8   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default How to average every 48 rows of data for 20,000 rows?

Another thought ..

Assume source data to be averaged is within A1:A20000

Put in B1:
=AVERAGE(OFFSET($A$1,ROWS($1:1)*48-48,,48))
Copy B1 down as far as required to say, B417? to cover the extent of source
data.

B1 returns the average of A1:A48, ie =AVERAGE(A1:A48)
B2 returns the average of the next 48 rows, ie: =AVERAGE(A49:A96)
and so on ..
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"akoskelo" wrote:
Hi. I have a huge spreadsheet (~20,000 rows). I need to average every 48 rows
into one value. Is there a quick and easy way to do this without scrolling
through all 20,000 rows and copy-pasting the "average" function every 48th
row?

Thank you.

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
Insert new rows based on Data in other rows mg_sv_r Excel Worksheet Functions 5 November 21st 07 01:51 PM
How can i randomly select 780 rows from 4000 rows of data bbb Excel Worksheet Functions 2 July 6th 07 08:21 PM
Copy rows of data (eliminating blank rows) from fixed layout Sweepea Excel Discussion (Misc queries) 1 March 13th 07 11:05 PM
Get number of rows that data uses, including blank rows Denham Coote Excel Discussion (Misc queries) 5 August 22nd 06 02:10 PM
Get number of rows that data takes up, including blank rows Denham Coote Excel Worksheet Functions 2 August 21st 06 09:18 AM


All times are GMT +1. The time now is 06:13 PM.

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"