Can I use a value to set the range of a SUM (i.e. SUM cell B5 and.

G

Guest

My variable is "# of weeks" and if I set it to "6", I want the formula to sum
the values from cell B5 down 6 entries. Or if I set it to "5", I want it to
sum the values from B5 down 5 entries....etc...
 
P

Peo Sjoblom

Assume the variable is in cell A1

=SUM($B$5:INDEX($B$5:$B$1000,A1))

it's better to use index instead of offset or indirect since it is not
volatile
 

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