View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
B. R.Ramachandran B. R.Ramachandran is offline
external usenet poster
 
Posts: 61
Default function like INDIRECT to return a range?

Hi,

If your data are contiguous in the column(s) referenced in the array
formula, the following method may work.

Supposing your data range is in A2:A999:
In an empty cell (say P2) enter the formula, ="A"&COUNT(A:A)+1 (The '1' at
the end corresponds to one less than the starting row number of your data
range. You have to modify that number if the range starts at some other row).
Now P2 will show the cell reference for the last row (in this example, A999)
In your array formula enter A2:INDIRECT(P2) to mimic the actual range, i.e.,
A2:A999; however, the formula will be dynamic and if more rows are added to
column A, the INDIRECT function will take care of it.

I hope this works!

Best regards,
B. R. Ramachandran

"Wilba" wrote:

Hello. I'm using an array formula that will only accept a finite range as a
parameter (e.g. A2:A999). The array formula will not accept a named range or
column reference (e.g. A:A). I'd like to specify the range dynamically
rather than hardcode it, for instance by using MATCH to find the first and
last rows with relevant data.

Something like INDIRECT would be perfect, but INDIRECT can only return a
cell reference, not a range (right?).

Any ideas? Thanks!