Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Dynamic Sum Ranger
 
Posts: n/a
Default Can I use a value to set the range of a SUM (i.e. SUM cell B5 and.

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...


  #2   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

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


--

Regards,

Peo Sjoblom

"Dynamic Sum Ranger" <Dynamic Sum wrote in
message ...
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...




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing a range name as an argument to the Index Function Michael Sharpe Excel Discussion (Misc queries) 3 September 5th 12 01:33 PM
ClearContents method on a passed range bryan New Users to Excel 2 January 19th 05 08:49 AM
Defined range difficulty Pat Excel Discussion (Misc queries) 7 January 16th 05 09:52 PM
named range refers to: in a chart Spencer Hutton Excel Discussion (Misc queries) 1 December 14th 04 10:15 PM
range names Pedro Excel Worksheet Functions 0 November 9th 04 06:26 PM


All times are GMT +1. The time now is 01:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"