get last non-blank value in a list code example

Example 1: formula for last filled cell in a column

'Excel formulas.

'Last filled cell in column A, confirm with Ctrl-Shift-Enter:
=INDEX(A:A,MAX((A:A>"")*(ROW(A:A))))


'Row number of last filled cell in column A, confirm with just Enter:
=INDEX(MAX((A:A>"")*(ROW(A:A))),1)

Example 2: excel formula for last non-empty cell in a column

'Excel formulas.

'Last filled cell in column A, confirm with Ctrl-Shift-Enter:
=INDEX(A:A,MAX((A:A>"")*(ROW(A:A))))


'Row number of last filled cell in column A, confirm with just Enter:
=INDEX(MAX((A:A>"")*(ROW(A:A))),1)

Tags:

Vb Example