Excel - find last value in a column which is not an error or blank

吃可爱长大的小学妹 提交于 2019-12-22 09:38:56

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!