View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
smartin smartin is offline
external usenet poster
 
Posts: 915
Default indirect cell reference

TomCser wrote:
I am trying to do a sum on certain sections of a list that is dynamic. So if
you assume you have a list of 100 cells in a column, and you determine that
you want to sum the values in three sections of this list. The start and
end rows of this list are in cells a1:b3. How would i use the sum function
to sum the values in these three sections?

Thanks in advance for your help!


Hi Tom,

Let's say your value cells are in C1:C100. I'm assuming columns A and B
are "start" and "stop" row numbers to sum. Then this works:

=SUM(OFFSET(C1,A1-1,0,B1-A1+1))+SUM(OFFSET(C1,A2-1,0,B2-A2+1))+SUM(OFFSET(C1,A3-1,0,B3-A3+1))

There are probably more elegant ways though.