strange sum question user inputs number of rows to sum in cell

D

dave h

i need to sum cells in column c in a dynamic range...the twist is...

the user selects the number of rows to sum, by an input into cell b3 eg user
enters 6 for the first 6 observations to be summed..

how do i get excel to sum the data from observation 1 to observation 6
inclusive? and i want the result in cell C2

ps observation 1 is eight rows down from row A

FYI Each row of my data has an observation number starting at 1 untill the
end of the dynamic range,if it helps the list will not be subsequently
sorted.

i know the easy way is to just use a manual =sum, but i need something more
dynamic as there are a number of calculations done in another column and
this model will used as a template for 200 models, where in each model the
number of rows summed will be different and chosen by the enduser
 
S

Sandy Mann

The cell that the formula is in is immaterial, a formula will work from any
cell. If I understand all you requirements then try:

=SUM(C8:INDIRECT("C"&B3+7))

HTH

Sandy
 
D

Dave Peterson

And I don't think you're going to want to put the sum of (say) c1:c6 into C2.
 
R

Ron Rosenfeld

i need to sum cells in column c in a dynamic range...the twist is...

the user selects the number of rows to sum, by an input into cell b3 eg user
enters 6 for the first 6 observations to be summed..

how do i get excel to sum the data from observation 1 to observation 6
inclusive? and i want the result in cell C2

ps observation 1 is eight rows down from row A

FYI Each row of my data has an observation number starting at 1 untill the
end of the dynamic range,if it helps the list will not be subsequently
sorted.

i know the easy way is to just use a manual =sum, but i need something more
dynamic as there are a number of calculations done in another column and
this model will used as a template for 200 models, where in each model the
number of rows summed will be different and chosen by the enduser

I understand that you want to sum a user specified number of observations (in
B3); and that the first observation is in B8 and the last observation would be
in a row n rows down from B8 where n is the contents of B3.

=SUM(OFFSET(B8,0,0,B3))


--ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top