简体   繁体   English

检查列中另一个工作表上是否存在Excel单元格 - 并返回其他列的内容

[英]Check if an excel cell exists on another worksheet in a column - and return the contents of a different column

What I want to do is to say if the contents of cell D3 (on current worksheet) exist in column A in the first worksheet (in my case entitled list). 我想要做的是说,如果单元格的内容D3列存在(当前工作表) A在第一个工作表(在我的情况下有权获得列表)。 (and they always do exist somewhere). (而且它们总是在某处存在)。 Return the contents of the corresponding row in Column C . 返回C列中相应行的内容。

In other words if the matching cell is found in Row 12 - return data from C12 . 换句话说,如果在第12行中找到匹配的单元格 - 从C12返回数据。

I've used the following syntax but I can't seem to get the last part to work correctly. 我使用了以下语法,但似乎无法使最后一部分正常工作。

=IF(ISERROR(MATCH(D3,List!A:A, 0)), "No Match", VLOOKUP(D3,List!A:A,1,TRUE))

How to fix the formula? 如何修复公式?

You can use following formulas. 您可以使用以下公式。

For Excel 2007 or later: 对于Excel 2007或更高版本:

=IFERROR(VLOOKUP(D3,List!A:C,3,FALSE),"No Match")

For Excel 2003: 对于Excel 2003:

=IF(ISERROR(MATCH(D3,List!A:A, 0)), "No Match", VLOOKUP(D3,List!A:C,3,FALSE))

Note, that 注意

  • I'm using List!A:C in VLOOKUP and returns value from column № 3 我在VLOOKUP使用List!A:C并从第3列返回值
  • I'm using 4th argument for VLOOKUP equals to FALSE , in that case VLOOKUP will only find an exact match, and the values in the first column of List!A:C do not need to be sorted (opposite to case when you're using TRUE ). 我使用了第四个参数VLOOKUP等于FALSE ,在这种情况下, VLOOKUP将只找到完全匹配的,并在第一列中的值List!A:C 不需要进行排序(相反情况下,当你使用TRUE )。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Excel-检查值是否存在于另一个工作表的列中并返回相邻列 - Excel - Check if value exists in a column in another worksheet and return adjacent column 检查其他多个工作表上是否存在excel单元格值-如果是,则返回存在于另一列中的工作表名称 - Check if an excel cell value exists on multiple other sheets - and if so return the name of the sheet it exists on in another column Excel函数帮助 - 将工作表中的2个单元格与另一个工作表中的2个单元格进行比较,如果它们匹配,则从其他列返回值 - Excel Function Help - Compare 2 Cells in Worksheet to 2 Cells in another worksheet, if they match, return value from a different column 检查“单元格”值是否存在于“列”中,并针对同一事件在同一行但不同列中返回值的总和 - Check if Cell value exists in Column and return a sum for a value in the same row but different column for each occurance 检查列中是否存在单元格值,返回同一行不同列中的值 - Check if a Cell Value exists in column, return a value in the same row but different column Excel-复制选定的单元格并粘贴到另一个工作表中列的末尾 - Excel - Copy selected cell and paste to the end of a column in another worksheet EXCEL:检查是否在另一列中找到单元格文本 - EXCEL: Check if cell text is found in another column Excel:检查列中是否已存在单元格值,然后减去并显示另一个值 - Excel: Check if cell value already exists in column, and then substract and show another value 检查Row中是否存在Cell值,并返回同一列但不同Row的值 - Check if Cell value exists in Row, and return a value in the same Column but different Row 将单元格内容从同一工作表中的一列复制到另一列---宏? - Copy cell contents from one column to another column in the same worksheet---Macro?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM