Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,560
Default Last Row Number in a Named Range

I have 3 Named Ranges that change as data is added. Unfortunately, they are
all in Column A.
I need a function that will tell me the row number of the last row with data
in the named range. If I can get one to work, I can do the other two.
One of the range names is MSE and is currently A2:A31. In this example, I'm
looking for a function that will return 31.
Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,886
Default Last Row Number in a Named Range

Hi David

If the data in MSE is text, then
=MATCH(LOOKUP("zzzzz",MSE),MSE,0)
You could use REPT("z"),255) in place of "zzzzz" if that is not enough
to be text that could not be found.
It will of course only return 30, not 31 as there are only 30 elements
in the range

If the data is numeric, you could use
=MATCH(LOOKUP(99^99,MSE),MSE,0)
--
Regards

Roger Govier


"David" wrote in message
...
I have 3 Named Ranges that change as data is added. Unfortunately, they
are
all in Column A.
I need a function that will tell me the row number of the last row
with data
in the named range. If I can get one to work, I can do the other two.
One of the range names is MSE and is currently A2:A31. In this
example, I'm
looking for a function that will return 31.
Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Last Row Number in a Named Range

Do you leave gaps in any of the named ranges? Or do you fill them
consecutively?

If no gaps, you could use this to get the last used cell in a single column
range:
=counta(MSE)+row(MSE)+1




David wrote:

I have 3 Named Ranges that change as data is added. Unfortunately, they are
all in Column A.
I need a function that will tell me the row number of the last row with data
in the named range. If I can get one to work, I can do the other two.
One of the range names is MSE and is currently A2:A31. In this example, I'm
looking for a function that will return 31.
Thanks!


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,560
Default Last Row Number in a Named Range

That works great on the first Range, but what it is doing is giving the Count
of the number in the range, not the Row Number of the last item in the range.
In the 2nd range for example, it gives 10, but is on row 45.
As the ranges will change...I need the row number of the last cell in the
range. Does that help you help me?
Thanks much!!

"Roger Govier" wrote:

Hi David

If the data in MSE is text, then
=MATCH(LOOKUP("zzzzz",MSE),MSE,0)
You could use REPT("z"),255) in place of "zzzzz" if that is not enough
to be text that could not be found.
It will of course only return 30, not 31 as there are only 30 elements
in the range

If the data is numeric, you could use
=MATCH(LOOKUP(99^99,MSE),MSE,0)
--
Regards

Roger Govier


"David" wrote in message
...
I have 3 Named Ranges that change as data is added. Unfortunately, they
are
all in Column A.
I need a function that will tell me the row number of the last row
with data
in the named range. If I can get one to work, I can do the other two.
One of the range names is MSE and is currently A2:A31. In this
example, I'm
looking for a function that will return 31.
Thanks!




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,560
Default Last Row Number in a Named Range

You da MAN Dave...although I changed the +1 to -1 to get what I was looking
for.
Thank you SO Much!

David

"Dave Peterson" wrote:

Do you leave gaps in any of the named ranges? Or do you fill them
consecutively?

If no gaps, you could use this to get the last used cell in a single column
range:
=counta(MSE)+row(MSE)+1




David wrote:

I have 3 Named Ranges that change as data is added. Unfortunately, they are
all in Column A.
I need a function that will tell me the row number of the last row with data
in the named range. If I can get one to work, I can do the other two.
One of the range names is MSE and is currently A2:A31. In this example, I'm
looking for a function that will return 31.
Thanks!


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Last Row Number in a Named Range

I meant -1 (stupid fingers screwed up!)

Glad you fixed it.



David wrote:

You da MAN Dave...although I changed the +1 to -1 to get what I was looking
for.
Thank you SO Much!

David

"Dave Peterson" wrote:

Do you leave gaps in any of the named ranges? Or do you fill them
consecutively?

If no gaps, you could use this to get the last used cell in a single column
range:
=counta(MSE)+row(MSE)+1




David wrote:

I have 3 Named Ranges that change as data is added. Unfortunately, they are
all in Column A.
I need a function that will tell me the row number of the last row with data
in the named range. If I can get one to work, I can do the other two.
One of the range names is MSE and is currently A2:A31. In this example, I'm
looking for a function that will return 31.
Thanks!


--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Last Row Number in a Named Range

This one will work with or without blank cells in between if all the text in
a range are unique

=MATCH(LOOKUP("zzzzz",MSE),A:A,0)


"David" wrote:

I have 3 Named Ranges that change as data is added. Unfortunately, they are
all in Column A.
I need a function that will tell me the row number of the last row with data
in the named range. If I can get one to work, I can do the other two.
One of the range names is MSE and is currently A2:A31. In this example, I'm
looking for a function that will return 31.
Thanks!

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
VBA: find number of columns in named range? George[_3_] Excel Discussion (Misc queries) 3 April 30th 07 05:35 PM
automatic range - named range give me circular reference... George Thorogood Excel Discussion (Misc queries) 0 February 22nd 07 07:53 PM
Array as a "named range" - formula ok in cells, but error as "named range" tskogstrom Excel Discussion (Misc queries) 11 December 28th 06 04:44 PM
Number of Rows & Columns in a Named Range Michael Excel Dude Excel Discussion (Misc queries) 0 September 3rd 06 11:05 PM
inserting a named range into new cells based on a named cell Peter S. Excel Discussion (Misc queries) 1 June 4th 06 03:53 AM


All times are GMT +1. The time now is 08:55 AM.

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"