Finding last row - non-VBA

Jack Sheet

New Member
Joined
Oct 18, 2007
Messages
37
Sorry for such a trivial question, but I want to define a named range without using VBA that embraces all used cells in a specified column. Unused cells between two used cells should be included in the range. Ie it should be a single continuous range starting with the first used cell in the column and ending with the last used cell in the column. And it needs to update on recalculation should a new last cell be entered since last file save.

Any help gratefully received.
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
=INDEX(Sheet1!$A$1:$A$100,MIN(IF(LEN(Sheet1!$A$1:$A$100)>0,ROW(Sheet1!$A$1:$A$100)))):INDEX(Sheet1!$A$1:$A$100,MAX(IF(LEN(Sheet1!$A$1:$A$100)>0,ROW(Sheet1!$A$1:$A$100))))

...change a1:a100 to a range of cells suitably larger than anything your data is likely to occupy - really is overkill testing all rows if you're never likely to get past 10,000 used etc...
 
Upvote 0
What is your definition of "used"? Do you need to include formula cells that may be returning "" rather than a value?
 
Upvote 0
Good point Rorya. I would want to include formula cells that return "". Thanks PaddyD I shall try that out
 
Upvote 0
Hi Jack

To include formula cells that return "", both at the beginning or at the end, try:

=INDEX(Sheet1!$A:$A,MATCH(1,(Sheet1!$A$1:$A$100<>"")+ISTEXT(Sheet1!$A$1:$A$100),0)):INDEX(Sheet1!$A:$A,LOOKUP(2,1/((Sheet1!$A$1:$A$1000<>"")+ISTEXT(Sheet1!$A$1:$A$1000)),ROW(Sheet1!$A$1:$A$1000)))
 
Upvote 0
I'd like to thank all y'all for your input.
I have found that the suggested solutions all work but seem to place an unacceptable burden on the overhead, by which I mean the time taken to recalculate the workbook gets irritating. So I have re-thought my whole approach, by using formulae within cells to identify the desired range, and it seems to run now quite smoothly. Anyway, I have libraried the solutions for dissection! Thanks again.

("Libraried" -- there is no noun that cannot be verbed)
 
Upvote 0

Forum statistics

Threads
1,215,523
Messages
6,125,318
Members
449,218
Latest member
Excel Master

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top