#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default sum data in a range?

hi,

i need to sum data from every 100 rows from top to bottom of total 50,000
rows. how to do it?
my data have two columns:
id score
1 45
2 60
3 85
.. .
.. .
.. .
100 96
.. .

so, the sum of 1st 100 rows =45+60+85+...+96
then next 100 rows, ... until to 50,000 rows.

thanks for your help.

pemt
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default sum data in a range?

Use this to test and then change to step 10, resize 9

Sub sumeverfewrows()
For i = 1 To Cells(Rows.Count, "a").End(xlUp).Row Step 4
MsgBox Application.Sum(Cells(i, "b"), Cells(i, "b").Resize(3))
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pemt" wrote in message
...
hi,

i need to sum data from every 100 rows from top to bottom of total 50,000
rows. how to do it?
my data have two columns:
id score
1 45
2 60
3 85
. .
. .
. .
100 96
. .

so, the sum of 1st 100 rows =45+60+85+...+96
then next 100 rows, ... until to 50,000 rows.

thanks for your help.

pemt


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default sum data in a range?

Say values in Column B, starting in B1 down:

Enter this formula *anywhere* (except Column B), and copy down as needed:
=SUM(INDEX(B:B,100*ROWS($1:1)-99):INDEX(B:B,ROWS($1:1)*100))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"pemt" wrote in message
...
hi,

i need to sum data from every 100 rows from top to bottom of total 50,000
rows. how to do it?
my data have two columns:
id score
1 45
2 60
3 85
. .
. .
. .
100 96
. .

so, the sum of 1st 100 rows =45+60+85+...+96
then next 100 rows, ... until to 50,000 rows.

thanks for your help.

pemt


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default sum data in a range?

thanks a lot!

"Don Guillett" wrote:

Use this to test and then change to step 10, resize 9

Sub sumeverfewrows()
For i = 1 To Cells(Rows.Count, "a").End(xlUp).Row Step 4
MsgBox Application.Sum(Cells(i, "b"), Cells(i, "b").Resize(3))
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pemt" wrote in message
...
hi,

i need to sum data from every 100 rows from top to bottom of total 50,000
rows. how to do it?
my data have two columns:
id score
1 45
2 60
3 85
. .
. .
. .
100 96
. .

so, the sum of 1st 100 rows =45+60+85+...+96
then next 100 rows, ... until to 50,000 rows.

thanks for your help.

pemt



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default sum data in a range?

thanks a lot!

"Ragdyer" wrote:

Say values in Column B, starting in B1 down:

Enter this formula *anywhere* (except Column B), and copy down as needed:
=SUM(INDEX(B:B,100*ROWS($1:1)-99):INDEX(B:B,ROWS($1:1)*100))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"pemt" wrote in message
...
hi,

i need to sum data from every 100 rows from top to bottom of total 50,000
rows. how to do it?
my data have two columns:
id score
1 45
2 60
3 85
. .
. .
. .
100 96
. .

so, the sum of 1st 100 rows =45+60+85+...+96
then next 100 rows, ... until to 50,000 rows.

thanks for your help.

pemt





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default sum data in a range?

You're welcome, and appreciate the feed-back.
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"pemt" wrote in message
...
thanks a lot!

"Ragdyer" wrote:

Say values in Column B, starting in B1 down:

Enter this formula *anywhere* (except Column B), and copy down as needed:
=SUM(INDEX(B:B,100*ROWS($1:1)-99):INDEX(B:B,ROWS($1:1)*100))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"pemt" wrote in message
...
hi,

i need to sum data from every 100 rows from top to bottom of total
50,000
rows. how to do it?
my data have two columns:
id score
1 45
2 60
3 85
. .
. .
. .
100 96
. .

so, the sum of 1st 100 rows =45+60+85+...+96
then next 100 rows, ... until to 50,000 rows.

thanks for your help.

pemt





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
Cond. Format Data Bars of range based on values of another range alexmo Excel Worksheet Functions 4 January 16th 09 04:03 AM
When entering data into a range of cells, select the entire range. Q Excel Discussion (Misc queries) 0 September 26th 07 04:36 AM
How do I link data from a horizontal range to a vertical range? davidge Excel Worksheet Functions 3 May 25th 07 08:06 AM
Show Data In Range not appearing in Separate Range Brent E Excel Discussion (Misc queries) 3 April 30th 07 09:32 PM
How do I change a range name back to the underlying data range? Colin Excel Worksheet Functions 1 September 26th 05 05:55 PM


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