View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
AKphidelt AKphidelt is offline
external usenet poster
 
Posts: 461
Default Sum over a variable number of cells

You can use sum and offset. For instance say your data is in A1 on down. You
put your variable in B1 And your result comes in C1. In C1 you put the formula

=SUM(OFFSET(A1,0,0,B1))

B1 is the number of cells that it will offset to. So if you put 3 and will
sum the first 3 cells, etc, etc.

"SD" wrote:

I am building a financial model and would like to sum values over a variable
number of preceeding cells (the number of cells should be inputted by a
user). How can I implement this functionality?