简体   繁体   English

Excel-在另一列中找到匹配项的行中获取列的值

[英]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.

相关问题 如何在另一列的一列中查找值并在找到值的行中返回单元格 - How to find a value in one column in another column and return cells in row where value was found 如何在另一个工作表上查找单元格值,并将值放在找到第一个值的行的另一列上 - How to find a cell value on another worksheet and place a value on another column for the row where the first value was found 如何在列中查找值并获取该行上另一列的值并在Excel中格式化该行? - How to find a value in a column and get the value of another column on that row and format that row in Excel? 如果在 A 列中找不到匹配项,请使用 VBA 将整行从一个 excel 工作表复制到另一个 - Use VBA to copy entire row from one excel worksheet to another if match is not found in Column A Excel,计算一列的总和,其中另一列中的相应行等于一个值 - Excel, Calculate Sum of one column where the corresponding row in another column equals a value 在Excel中,对每行中一列中的所有值求和,其中另一列是特定值 - In Excel, sum all values in one column in each row where another column is a specific value Excel - 匹配值并获取其他列的值 - Excel - Match Value and Get Value of Other Column Excel - 如何获得其中一列中的值为 X 而另一列中的值为 Y 的单元格的平均值? - Excel - How can I get the average of cells where the value in one column is X and the value in another column is Y? Excel公式:对于列中值的每个实例,获取同一行中另一列的值 - Excel formula: For each instance of value in column, get value of another column in same row Excel:如何查找列的第一行的值,具体取决于在同一列的另一行中查找给定数字的位置 - Excel: How to find the first row's value of a column depending on where to find a given number in another row of the same column
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM