在UNDERDERED值范围内查找最后一个非零单元格的列引用 [英] Find last non-zero cell's column reference in an UNORDERED range of values
本文介绍了在UNDERDERED值范围内查找最后一个非零单元格的列引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Excel中连续有一个数字范围,例如:
I have a range with numbers in a row in Excel, say:
A B C D E F G H I J K L
Line 1 => 0 0 0 3 2 8 3 6 0 0 0 0
所有单元格都是非空白的,但是有些包含零,有些包含数字.另外,范围不能以升序或降序排序.
All cells are non-blank but some contain zeros and some contain numbers. Also, the range cannot be ordered in either ascending or descending order.
我需要一个公式(不是VBA),该公式将返回范围内最后一个非零值的列(即,上面的单元格H1的列8).我可以使用以下公式获取单元格H1的实际值:
I need a formula (not VBA) that will return the column of the last non-zero value in the range (i.e. column 8 for cell H1 above). I can get the actual value of cell H1 with this formula:
LOOKUP(2,1/(A1:A10<>0),A1:A10)
但是我找不到一种方法来获取该单元格的列号.
but I cannot find a way to get the column number for that cell.
有什么想法吗?
推荐答案
您非常亲密:
=LOOKUP(2,1/(A1:L1<>0),COLUMN(A1:L1))
这篇关于在UNDERDERED值范围内查找最后一个非零单元格的列引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文