ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Dynamically set a range? (https://www.excelbanter.com/excel-worksheet-functions/85651-dynamically-set-range.html)

BKGT

Dynamically set a range?
 

Is there a way to dynamically set a range? For instance... can I have a
formula that includes a range (Ax:Ay) where I can set the values of x
and y based on the value of another cell so that in one case, the range
may be A1:A80 and in another it may be A50:A60 and so on?

Thanks.


--
BKGT
------------------------------------------------------------------------
BKGT's Profile: http://www.excelforum.com/member.php...o&userid=33862
View this thread: http://www.excelforum.com/showthread...hreadid=536778


Richard Buttrey

Dynamically set a range?
 
On Thu, 27 Apr 2006 08:17:57 -0500, BKGT
wrote:


Is there a way to dynamically set a range? For instance... can I have a
formula that includes a range (Ax:Ay) where I can set the values of x
and y based on the value of another cell so that in one case, the range
may be A1:A80 and in another it may be A50:A60 and so on?

Thanks.


Use the Indirect Function

If your x & y variable cells are say B1 & B2

then with B1=50 and B2=60 and if (say) you're summing A50:A60, your
formula would be

=SUM(INDIRECT("A"&B1&":A"&B2))

HTH


__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________

Arvi Laanemets

Dynamically set a range?
 
Hi

Like this:

=SUM(INDIRECT(A1))
, where A1 contains string like "A1:A80"


--
Arvi Laanemets
( My real mail address: arvi.laanemets<attarkon.ee )



"BKGT" wrote in message
...

Is there a way to dynamically set a range? For instance... can I have a
formula that includes a range (Ax:Ay) where I can set the values of x
and y based on the value of another cell so that in one case, the range
may be A1:A80 and in another it may be A50:A60 and so on?

Thanks.


--
BKGT
------------------------------------------------------------------------
BKGT's Profile:
http://www.excelforum.com/member.php...o&userid=33862
View this thread: http://www.excelforum.com/showthread...hreadid=536778




BKGT

Dynamically set a range?
 

Great. That worked for me.

Thanks for the help and the quick responses.


--
BKGT
------------------------------------------------------------------------
BKGT's Profile: http://www.excelforum.com/member.php...o&userid=33862
View this thread: http://www.excelforum.com/showthread...hreadid=536778



All times are GMT +1. The time now is 06:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com