简体   繁体   English

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

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.

相关问题 Excel VBA - 在表列中查找给定值的行号 - Excel VBA - Find Row Number for Given Value in a Table Column 如何在另一个工作表上查找单元格值,并将值放在找到第一个值的行的另一列上 - 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 VBA - How to find text in a column and saving the row number where it is first found - Excel VBA Excel VBA —查找列A中任何值的第一个出现位置,然后将列B的值插入列C(同一行) - Excel VBA — Find first occurrence of any value in column A, then insert value of column B into column C (same row) 如何在Excel列中查找文本值所有出现的行号 - How to find the row number of all occurances of a text value in excel column 根据Excel中第一列的变量查找行的最后一个值 - Finding last value of row depending on the first column's variable in Excel Excel行/列和编号取决于另一个单元格 - Excel Row/Column and number depending on another cell 如何在列中查找值并获取该行上另一列的值并在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? 在excel中的多个工作表中查找给定列和行的值的函数 - Function to find value given column and row across multiple worksheets in excel Excel VBA - 在表列中查找给定值的多个行号 - Excel VBA - Find several row numbers for given value in table column
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM