问题
I need to find in a column of an excel spreadsheet the last non-error, non-blank value. The column can have several instaces of #N/A which are alternating with actual values. There are several solutions for finding the last non-empty cell, but the solutions do not consider errors, in particular if the last non-empty cell has got an error.
The solution would be 3 in this case.
    回答1:
Try this formula
=LOOKUP(2,1/(A1:A100<>""),A1:A100)
extend range as required. In Excel 2007 and later you can use the whole column
回答2:
Eliminate #N/A error cells by using IFERROR(. . .
then
{=MAX(COLUMN(A4:A150)*(A4:A150<>0))} if A1 -style
or
{=MAX(COLUMN(RC4:RC150)*(RC4:RC150<>0))} if RC -style
{} ... array formula . .. ctrl+shift+enter
For Row - replace COLUMN with ROW
来源:https://stackoverflow.com/questions/11100119/excel-find-last-value-in-a-column-which-is-not-an-error-or-blank