View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.misc
Eric Eric is offline
external usenet poster
 
Posts: 1,670
Default Find last non-blank cell in range

Thanks! That formula is a lesson in itself. It will take me a while to
figure it out, but I'm sure I'll learn a lot in the process.

"Rick Rothstein (MVP - VB)" wrote:

How can I find the last (meaning bottom, or right-most)
non-empty cell in a range?


I think these should work for you....

Last Used Column
***********************
=SUMPRODUCT(MAX((COLUMN(A1:H17)*(A1:H17<""))))

Last Used Row
***********************
=SUMPRODUCT(MAX((ROW(A1:H17)*(A1:H17<""))))

Change the ranges to suit your needs.


I think I misread what you wanted. I think the following does what you
want...

Last Used Column
**************************************************
=SUMPRODUCT(MAX((COLUMN(A1:H17)*(A1:H17<""))))

Last Non-Used Cell in Last Used Column
**************************************************
=1+SUMPRODUCT(MAX((COLUMN(INDIRECT("A"&SUMPRODUCT( MAX((ROW(A1:H17)*(A1:H17<""))))&":"&"H"&SUMPRODUC T(MAX((ROW(A1:H17)*(A1:H17<""))))))*(INDIRECT("A" &SUMPRODUCT(MAX((ROW(A1:H17)*(A1:H17<""))))&":"&" H"&SUMPRODUCT(MAX((ROW(A1:H17)*(A1:H17<"")))))<" "))))

I'm pretty sure there are more efficient formulas to be had. Anyway, while
I'm looking for them, you can use the above in the meantime...

Rick