[英]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
Imagine a 100x100 table. 想象一张100x100的桌子。 I have to find a given value in the first column.
我必须在第一列中找到给定的值。 Then I have to check the row contains that given value, and I have to find the column where the value is 1 (every row has only one cell with value 1), and I need the first row's value of that column.
然后,我必须检查包含给定值的行,并且必须找到该值为1的列(每行只有一个值为1的单元格),并且我需要该列的第一行的值。 I've tried several lookup functions (vlookup, hlookup, index match match, etc).
我尝试了几种查找功能(vlookup,hlookup,索引匹配匹配等)。 No results.
没结果。 Is it possible using only functions and no VBA at all?
是否可以仅使用功能而不使用VBA?
I'd prefer to use INDEX
rather than INDIRECT
, it's not volatile and it's more robust in dealing with added rows or columns than "hardcoded" values like "B" and "D", so assuming data in A1:Z100
you can use this formula for the match, assuming a search value of "x" 我宁愿使用
INDEX
而不是INDIRECT
,它不易变,并且在处理添加的行或列方面比“ B”和“ D”之类的“硬编码”值更健壮,因此假设A1:Z100
数据可以使用匹配的公式,假设搜索值为“ x”
=MATCH(1,INDEX(B2:Z100,MATCH("x",A2:A100,0),0),0)
...and you can add an extra INDEX function to retrieve the first row value for that column ...并且您可以添加一个额外的INDEX函数来检索该列的第一行值
=INDEX(B1:Z1,MATCH(1,INDEX(B2:Z100,MATCH("x",A2:A100,0),0),0))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.