简体   繁体   English

Excel:获取最后一个可见细胞的价值

[英]Excel : Get Value Of Last Visible Cell

i am using this formula in cell B1 to get last value of visible cell 我在单元格B1中使用此公式来获取可见单元格的最后一个值

=LOOKUP(2;1/((SUBTOTAL(3;OFFSET(A2:A10;ROW(A2:A10)-MIN(ROW(A2:A10));0;1)))*(1-ISBLANK(A2:A10)));A2:A10)

this formula work good when cell from A1 to A10 not contains formula the problem is this formula not working when the cell have formula like if statement example : in cell a10 i put this formula =IF(F1=1;1;"") the cell a10 show blank because the condition not true - and when i filter data the cell B1 show blank 当从A1到A10的单元格不包含公式时,这个公式工作正常问题是这个公式不起作用当单元格有公式时如if语句示例:在单元格a10中我把这个公式=IF(F1=1;1;"") the cell a10 show blank because the condition not true - and when i filter data the cell B1 show blank

Replace: 更换:

1-ISBLANK(A2:A10)

with: 有:

LEN(A2:A10)>0

Regards 问候

I would use some different formula for that purpose. 我会为此目的使用一些不同的公式。 One option (array formula - Ctrl + Shift + Enter): 一个选项(数组公式 - Ctrl + Shift + Enter):

=INDIRECT("A"&MAX(IF(A2:A10="";0;ROW(A2:A10))))

another array formula option: 另一个数组公式选项:

=INDEX(A2:A10;MAX(IF(A2:A10="";0;ROW(A2:A10)))-1)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM