[英]Excel - Get value of a column in a row where match found in another column
I need to track where value in J
column starts appearing zero. 我需要跟踪
J
列中的值开始显示为零的位置。 In following table, its 7th row. 在下表中,其第七行。 From this row, I need to get value of
D
column to appear in some designated Cell outside this table. 从这一行,我需要获取
D
列的值以出现在此表外部的某些指定单元格中。 In this case it would be 11 y, 2 m
. 在这个例子中是
11 y, 2 m
。
I used offset
function, that gives me first occurrence of zero in J
column. 我使用了
offset
功能,这使我在J
列中首次出现零。 But I'm not sure how to lookup different column ( D
) from the same row to fetch it's value. 但是我不确定如何从同一行中查找不同的列(
D
)以获取其值。
My formula: =OFFSET(J1,MATCH(0,J:J,0)-1,0)
我的公式:
=OFFSET(J1,MATCH(0,J:J,0)-1,0)
Here actual data starts at first row; 此处的实际数据从第一行开始; hence 1 is used above.
因此上面使用了1。 It correctly returns first zero (0) occurrence in J column.
它正确返回J列中的第一个零(0)事件。
Assuming the column is sorted so that the first zero is the only zero that matters, one of many solutions is Index Match. 假设对列进行了排序,则第一个零是唯一重要的零,因此许多解决方案之一就是“索引匹配”。
=Index(D:D,Match(0,J:J,0))
Index
returns the value of nth position in a list. Index
返回列表中第n个位置的值。 Match
returns the position of the of the first match in a list; Match
返回列表中第一个匹配项的位置; the 0
at the end is a parameter to specify an exact match. 末尾的
0
是用于指定完全匹配的参数。 When both lists are the same length, such as two columns in a table, then you use Match
to find the index and use Index
to find the value of an arbitrary column. 当两个列表的长度相同时(例如表中的两个列),则可以使用
Match
查找索引,并使用Index
查找任意列的值。
So, in this example, Match
returns 7. The 7th position in Column D is 11y, 2m 因此,在此示例中,
Match
返回7。D列中的第7个位置是11y,2m
In the very near future (or right now for some people) you will be able to use XLookup
to do the same thing. 在不久的将来(或现在对于某些人而言),您将可以使用
XLookup
执行相同的操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.