Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Branko
 
Posts: n/a
Default multiple cell references


If I have in a cell reference
=SUM(A3:A300)
how to have 3 and 300 referenced to another cell so that I can change range
without changing formula?
  #2   Report Post  
David McRitchie
 
Posts: n/a
Default


You could use a defined name for the range, or if you really must
you could use INDIRECT
=SUM(INDIRECT($B$3))

but possibly you are trying to compensate for a formula that
might better be written as
=SUM(A$3, OFFSET(A301,-1,0))
if you are concerned about inserting or deleting rows
above row 301 and below row 3.

http://www.mvps.org/dmcritchie/excel/offset.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Branko" wrote in message ...

If I have in a cell reference
=SUM(A3:A300)
how to have 3 and 300 referenced to another cell so that I can change range
without changing formula?



  #3   Report Post  
Branko
 
Posts: n/a
Default

What I want is to have 3 and 300 (in my example) in another cell as variable
so by changing those inputs I would change the desired range.

"David McRitchie" wrote:


You could use a defined name for the range, or if you really must
you could use INDIRECT
=SUM(INDIRECT($B$3))

but possibly you are trying to compensate for a formula that
might better be written as
=SUM(A$3, OFFSET(A301,-1,0))
if you are concerned about inserting or deleting rows
above row 301 and below row 3.

http://www.mvps.org/dmcritchie/excel/offset.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Branko" wrote in message ...

If I have in a cell reference
=SUM(A3:A300)
how to have 3 and 300 referenced to another cell so that I can change range
without changing formula?




  #4   Report Post  
David McRitchie
 
Posts: n/a
Default

Sorry I had not tested INDIRECT

=SUM(INDIRECT(L18 & ":" & M18)) where L18: A3 and M18: A300

=SUM(INDIRECT(TEXT(L17,"@"))) where L17: A3:A300

must be a shorter solution using INDIRECT

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Branko" wrote in message ...
What I want is to have 3 and 300 (in my example) in another cell as variable
so by changing those inputs I would change the desired range.

"David McRitchie" wrote:


You could use a defined name for the range, or if you really must
you could use INDIRECT
=SUM(INDIRECT($B$3))

but possibly you are trying to compensate for a formula that
might better be written as
=SUM(A$3, OFFSET(A301,-1,0))
if you are concerned about inserting or deleting rows
above row 301 and below row 3.

http://www.mvps.org/dmcritchie/excel/offset.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Branko" wrote in message ...

If I have in a cell reference
=SUM(A3:A300)
how to have 3 and 300 referenced to another cell so that I can change range
without changing formula?






  #5   Report Post  
Branko
 
Posts: n/a
Default

Thank you David, it works.

"David McRitchie" wrote:

Sorry I had not tested INDIRECT

=SUM(INDIRECT(L18 & ":" & M18)) where L18: A3 and M18: A300

=SUM(INDIRECT(TEXT(L17,"@"))) where L17: A3:A300

must be a shorter solution using INDIRECT

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Branko" wrote in message ...
What I want is to have 3 and 300 (in my example) in another cell as variable
so by changing those inputs I would change the desired range.

"David McRitchie" wrote:


You could use a defined name for the range, or if you really must
you could use INDIRECT
=SUM(INDIRECT($B$3))

but possibly you are trying to compensate for a formula that
might better be written as
=SUM(A$3, OFFSET(A301,-1,0))
if you are concerned about inserting or deleting rows
above row 301 and below row 3.

http://www.mvps.org/dmcritchie/excel/offset.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Branko" wrote in message ...

If I have in a cell reference
=SUM(A3:A300)
how to have 3 and 300 referenced to another cell so that I can change range
without changing formula?








  #6   Report Post  
David McRitchie
 
Posts: n/a
Default

You're welcome.

This is a bit better the A1 is to indicate type of reference A1 or R1C1
syntax: INDIRECT(ref_text,a1)

=SUM(INDIRECT(L1, True) where L1: 'A3:A300

since True is the default and is for A1 style reference, I don't know
why this originally failed when I tested, perhaps I had a leading
space in the L1 value
=SUM(INDIRECT(L1))


I will update my indirect.htm web page accordingly
http://www.mvps.org/dmcritchie/excel/indirect.htm
and test my replies a bit more often as well.
---
David


"Branko" wrote in message ...
Thank you David, it works.

"David McRitchie" wrote:

Sorry I had not tested INDIRECT

=SUM(INDIRECT(L18 & ":" & M18)) where L18: A3 and M18: A300

=SUM(INDIRECT(TEXT(L17,"@"))) where L17: A3:A300

must be a shorter solution using INDIRECT

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Branko" wrote in message ...
What I want is to have 3 and 300 (in my example) in another cell as variable
so by changing those inputs I would change the desired range.

"David McRitchie" wrote:


You could use a defined name for the range, or if you really must
you could use INDIRECT
=SUM(INDIRECT($B$3))

but possibly you are trying to compensate for a formula that
might better be written as
=SUM(A$3, OFFSET(A301,-1,0))
if you are concerned about inserting or deleting rows
above row 301 and below row 3.

http://www.mvps.org/dmcritchie/excel/offset.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Branko" wrote in message ...

If I have in a cell reference
=SUM(A3:A300)
how to have 3 and 300 referenced to another cell so that I can change range
without changing formula?










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
apply cell names to formulas in multiple worksheets BBurrows Excel Worksheet Functions 4 July 1st 05 05:35 PM
Other than the cell not being wide enough, what do the multiple #. Dave @ Metals USA Excel Discussion (Misc queries) 3 March 22nd 05 08:35 PM
Re What is the formula for adding multiple numbers in a cell merlin_au Excel Discussion (Misc queries) 2 January 4th 05 11:50 AM
Using the MAX function with "constant increment" cell references John Dwyer Excel Worksheet Functions 3 December 10th 04 03:37 PM
Transferring cell content between workbooks using cell references Kiwi Mike Excel Discussion (Misc queries) 2 November 27th 04 11:31 PM


All times are GMT +1. The time now is 04:57 AM.

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"