Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Variable row number in Sum($A$1:A10) formula

I need to be able to change the length of the string of numbers in a column
being added using the Sum formula such as: =Sum($A$1:A10), where A10 is a
variable adjusted by a reference to the number of rows to add in an different
cell (C1).
For instance, if C1 is the reference cell and C1 = 20, the the fomula should
automatically change to =Sum($A$1:A20).
How can this be accomplished?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Variable row number in Sum($A$1:A10) formula

=SUM(INDIRECT("A1:A"&C1))
--
Gary''s Student - gsnu200909
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Variable row number in Sum($A$1:A10) formula

=SUM(OFFSET(A1,0,0,C1,1))

Entered in B1


Gord Dibben MS Excel MVP



On Thu, 3 Dec 2009 11:45:01 -0800, Migo1
wrote:

I need to be able to change the length of the string of numbers in a column
being added using the Sum formula such as: =Sum($A$1:A10), where A10 is a
variable adjusted by a reference to the number of rows to add in an different
cell (C1).
For instance, if C1 is the reference cell and C1 = 20, the the fomula should
automatically change to =Sum($A$1:A20).
How can this be accomplished?


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Variable row number in Sum($A$1:A10) formula

Another one...

=SUM(A1:INDEX(A:A,C1))

If C1 is an empty cell the entire range will be calculated.

--
Biff
Microsoft Excel MVP


"Migo1" wrote in message
...
I need to be able to change the length of the string of numbers in a column
being added using the Sum formula such as: =Sum($A$1:A10), where A10 is a
variable adjusted by a reference to the number of rows to add in an
different
cell (C1).
For instance, if C1 is the reference cell and C1 = 20, the the fomula
should
automatically change to =Sum($A$1:A20).
How can this be accomplished?



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
Sum over a variable number of cells SD Excel Discussion (Misc queries) 4 April 29th 23 07:44 PM
Applying formula to variable number of rows Shikha Excel Worksheet Functions 5 March 3rd 09 02:32 PM
Macro - Formula RC[?] with ? being a variable number steven.holloway Excel Discussion (Misc queries) 5 July 18th 08 10:07 AM
How to sum a variable number of items RobinC Excel Worksheet Functions 2 May 30th 08 08:14 AM
Variable Determines Number of Cell in Formula Range MJSlattery Excel Worksheet Functions 0 March 30th 06 01:28 AM


All times are GMT +1. The time now is 11:32 PM.

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

About Us

"It's about Microsoft Excel"