Using the formula
=MAX(INDEX(($A$1:$Z$2500<>"")*ROW($A$1:$Z$2500),0))
we can get the last filled row of a range. That is the max row number with a filled cell in it.
And using
=MAX(INDEX(($A$1:$Z$2500<>"")*COLUMN($A$1:$Z$2500),0))
we can get the last filled column of a range. That is the max colunmn number with a filled cell in it.
But we need getting the last filled column in the last filled row. So we can using a trick. We do multiplying the row numbers by 10000 and then add up the appropriate column number. So we can get the max of this sums of row number+column number as the last filled column in the last filled row. To get the row number out of this sum, we divide the sum by 10000. To get the column number out of this sum, we take the remainder of this division.
Example:
Formulas:
AA1
:
=MAX(INDEX(($A$1:$Z$2500<>"")*ROW($A$1:$Z$2500),0))
AA2
:
=MAX(INDEX(($A$1:$Z$2500<>"")*COLUMN($A$1:$Z$2500),0))
AA3
:
=MAX(INDEX(($A$1:$Z$2500<>"")*(ROW(A1:Z2500)*10000+COLUMN($A$1:$Z$2500)),0))
AA4
:
=INDEX($A$1:$Z$2500,MAX(INDEX(($A$1:$Z$2500<>"")*(ROW($A$1:$Z$2500)*10000+COLUMN($A$1:$Z$2500)),0))/10000,MOD(MAX(INDEX(($A$1:$Z$2500<>"")*(ROW($A$1:$Z$2500)*10000+COLUMN($A$1:$Z$2500)),0)),10000))