Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
tjtjjtjt
 
Posts: n/a
Default Dynamic Named Range with blank cells

I have been using the Dynamic Named Range I've seen on www.contextures.com
and posted here a few times:
=OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),1)

I was looking for an alternative (see below) that would allow for blanks in
the Named Range. I've used a formula I found posted here for locating the
last value in a column to modify the above function. It sems to be working
when I add values into the column and try basic funcitons using values in the
range.
the only restriction I'm sure of is that the start of the range has to be in
Row 1.

Does anyone see a potential pitfall that I'm missing? I don't want to use
this in a live worksheet until I'm certain it's working. Thanks.

=OFFSET(Sheet1!$A$1,0,0,MATCH(LOOKUP(2,1/(Sheet1!$A$1:$A$655350),Sheet1!$A$1:$A$65535),She et1!$A$1:$A$65535,0),1)

--
tj
  #2   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

tj,

It blows up when the last value of the column is not unique: i.e., it is repeated somewhere above in
the column. MATCH only looks for a match, no matter where, and the value that it is looking for is
the last value of the column.

HTH,
Bernie
MS Excel MVP

Does anyone see a potential pitfall that I'm missing? I don't want to use
this in a live worksheet until I'm certain it's working. Thanks.




  #3   Report Post  
tjtjjtjt
 
Posts: n/a
Default

Thanks, Bernie. I knew some problem must be there somewhere - it looked too
simple.
--
tj


"Bernie Deitrick" wrote:

tj,

It blows up when the last value of the column is not unique: i.e., it is repeated somewhere above in
the column. MATCH only looks for a match, no matter where, and the value that it is looking for is
the last value of the column.

HTH,
Bernie
MS Excel MVP

Does anyone see a potential pitfall that I'm missing? I don't want to use
this in a live worksheet until I'm certain it's working. Thanks.





  #4   Report Post  
Domenic
 
Posts: n/a
Default

Try the following...

=OFFSET(Sheet1!$A$2,0,0,MATCH(2,1/(1-ISBLANK(Sheet1!$A$2:$A$65536))))

or

=Sheet1!$A$2:INDEX(Sheet1!$A$2:$A$65536,MATCH(2,1/(1-ISBLANK(Sheet1!$A$2:
$A$65536))))

....which eliminates the use of the volatile function OFFSET. Note that
you cannot use whole column references.

Hope this helps!

In article ,
"tjtjjtjt" wrote:

I have been using the Dynamic Named Range I've seen on www.contextures.com
and posted here a few times:
=OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),1)

I was looking for an alternative (see below) that would allow for blanks in
the Named Range. I've used a formula I found posted here for locating the
last value in a column to modify the above function. It sems to be working
when I add values into the column and try basic funcitons using values in the
range.
the only restriction I'm sure of is that the start of the range has to be in
Row 1.

Does anyone see a potential pitfall that I'm missing? I don't want to use
this in a live worksheet until I'm certain it's working. Thanks.

=OFFSET(Sheet1!$A$1,0,0,MATCH(LOOKUP(2,1/(Sheet1!$A$1:$A$655350),Sheet1!$A$1:
$A$65535),Sheet1!$A$1:$A$65535,0),1)

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
repost: plz help- dynamic range with gaps? KR Excel Discussion (Misc queries) 2 August 29th 05 08:57 PM
Blank cells in named range- how to ignore them when making my graph? Help plz! KR Excel Discussion (Misc queries) 0 August 24th 05 02:35 PM
How can I replace a range of blank cells with a 0 Replacing blank cells Excel Discussion (Misc queries) 1 August 19th 05 12:01 AM
Condensing a list/range with blank cells to a new list/range without blanks KR Excel Worksheet Functions 4 July 5th 05 04:23 PM
Counting empty cells within a range of cells Rosehill - ExcelForums.com New Users to Excel 2 May 2nd 05 08:53 AM


All times are GMT +1. The time now is 06:58 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"