ScottBarnes
asked on
Excel Formula to find last row
Could someone help me with an excel formula to find the last row in column A even if the data has blanks scattered throughout?
Thanks in advance.
Scott Barnes
Thanks in advance.
Scott Barnes
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry for not specifying but I need to be able do this using a formula, not vba, it will be used in name manager for a pivot table. The trick is that the data will sometimes have blanks. If row 10 is blank and row 11 had data again, I don't want it to return that 9 is the last row.
Currently I'm using this and it doesn't work correctly when there are blanks.
=OFFSET(PivotData!$A$1,0,0 ,MAX(2,COU NTA(PivotD ata!$A:$A) ),COUNTA(P ivotData!$ 1:$1))
Thank you,
Currently I'm using this and it doesn't work correctly when there are blanks.
=OFFSET(PivotData!$A$1,0,0
Thank you,
Please see my previous post.
Try this.....
=OFFSET(PivotData!$A$1,0,0,MAX(INDEX((PivotData!A:A<>"")*ROW(PivotData!A:A),0)),COUNTA(PivotData!$1:$1))
@Scott: Please consider Requesting Attention so that you can split the points between sktneer and I since all I did was to modify his formula.
The following formula will return you the row of last cell with data in the range A1:A20
Open in new window
VBA Solution:
The following code will return you the last row with data in col. A
Open in new window