View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Sum over a variable number of cells

The following formula will sum the values begriming in cell D2 and
extending to the right for the number of columns specified in cell A1.

=SUM(OFFSET($D$2,0,0,1,A1))

So, for example, if A1 = 4, the formula will sum the range D2:G2.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Wed, 22 Oct 2008 11:26:01 -0700, 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?