Row of Last non-blank cell in column Dynamic Named Range

Jeffrey Mahoney

Well-known Member
Joined
May 31, 2015
Messages
3,212
Office Version
  1. 365
Platform
  1. Windows
I currently use this as part of my OFFSET function to find the last used row because it works with for both numbers and text.
MAX((AB:AB<>"")*ROW(AB:AB))

I've tried using Match(1e+300,AC:AC,1) which will find the last row if all the cells contain numbers. Also Match("zzzzzzzzzzz",AC:AC,1) which works for text.

Does anybody else use something more simple?
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
I need a bit of clarification here. When you say "last row", are you referring to the actual row # of the excel spread sheet? Or the n-th row of your dynamic array. In the example below, suppose your array is from A4:A16. Would your last row be 13 or 10 (the 10th element of the dynamic array)?

1711647494998.png
 
Upvote 0
How about

Excel Formula:
=ROW(XLOOKUP(TRUE,A:A<>"",A:A,,0,-1))

Don't know if that consider simpler.
 
Upvote 0
Some variations of the above.
Excel Formula:
=MAX(MATCH(2,1/(A:A<>""),1),1)
Excel Formula:
=AGGREGATE(14,6,ROW(A:A)/(A:A<>""),1)
 
Upvote 0
Thank you Cubist and Tetra,

Those are interesting variations on the same theme also using two functions. I appreciate your time. I'm going to continue using my solution for dynamic named ranges like this:
=$AC$8:INDEX($AC:$AC,MAX((AC:AC<>"")*ROW(AC:AC)))

Brown Bag Lunch Ideas.xlsm
ACAD
7Clean IDSeries
8805550218 Series
9805550218 Series
105221220485 Series
11805179988 Series
12802926828 Series
13801069988 Series
1438160118AOther
15805586758 Series
16805586758 Series
176020494006 Series
Sheet2
 
Upvote 0

Forum statistics

Threads
1,224,856
Messages
6,181,427
Members
453,040
Latest member
Santero

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