ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Constructing range address given row and col numbers of boundaries (https://www.excelbanter.com/excel-worksheet-functions/55749-constructing-range-address-given-row-col-numbers-boundaries.html)

[email protected]

Constructing range address given row and col numbers of boundaries
 

Suppose cells A1 and A2 contain the start row and start column of a
given range and cells B1 and B2 contain the end row and end column of
this range, my rather awkward solution to constructing a range address
that I can use in a formula is:

= INDIRECT(Address(A2,A1) & ":" & Address(B2,B1))

Is there a more elegant way to set this up?

Thanks!
K


Bob Phillips

Constructing range address given row and col numbers of boundaries
 
Assuming you have letters in A2 and B2 you can just use

=INDIRECT(A2&A1&":"&B2&B1)

--

HTH

RP
(remove nothere from the email address if mailing direct)


wrote in message
oups.com...

Suppose cells A1 and A2 contain the start row and start column of a
given range and cells B1 and B2 contain the end row and end column of
this range, my rather awkward solution to constructing a range address
that I can use in a formula is:

= INDIRECT(Address(A2,A1) & ":" & Address(B2,B1))

Is there a more elegant way to set this up?

Thanks!
K





Arvi Laanemets

Constructing range address given row and col numbers of boundaries
 
Hi

Entrer the number of rows/columns in range into B1/B2, and this formula will
do
=OFFSET($A$1,$A$1-1,$A$2-1,$B$1,$B$2)

Arvi Laanemets


wrote in message
oups.com...

Suppose cells A1 and A2 contain the start row and start column of a
given range and cells B1 and B2 contain the end row and end column of
this range, my rather awkward solution to constructing a range address
that I can use in a formula is:

= INDIRECT(Address(A2,A1) & ":" & Address(B2,B1))

Is there a more elegant way to set this up?

Thanks!
K




[email protected]

Constructing range address given row and col numbers of boundaries
 
I have the actual row and column numbers in A1,A2,B1,B2 (returned from
a different formula)..


[email protected]

Constructing range address given row and col numbers of boundaries
 
Great! Thanks!



All times are GMT +1. The time now is 01:30 AM.

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