简体   繁体   English

如果列a包含x,则在与x相同的行中找到y并显示值

[英]If column a contains x find y in same row as x and display value

CLOSED: Thanks alot, it's all sorted! 停止营业:非常感谢,一切顺利!

The title pretty much sums it up. 标题几乎总结了一下。 I am pulling a dataset and pasting it into a seperate sheet(in this instance "CSV") and I need the first sheet to look down a particular column (in this instance H) and search for a particular value (in the instance A2 or "3019") and once located search for the value in another column of the same row (in this instance column K). 我正在提取数据集并将其粘贴到单独的工作表中(在本例中为“ CSV”),我需要第一张工作表向下查看特定列(在此例中为H)并搜索特定值(在实例A2或“ 3019”),并且一旦找到就在同一行的另一列(在本例中为K列)中搜索值。

So far I have got the formula to search for it =IF(CSV!H2:H100=A2,"yes") and it seems to sporadically work (sometimes reading "yes", sometimes reading "FALSE") 到目前为止,我已经找到了可以搜索它的公式= IF(CSV!H2:H100 = A2,“是”),它似乎偶尔起作用(有时读为“是”,有时读为“ FALSE”)

Can anyone give me some pointers? 谁能给我一些指导?

Feel free to get me to clarify as required. 请让我根据需要进行澄清。

Thanks, James 谢谢,詹姆斯

You can use VLOOKUP : 您可以使用VLOOKUP

=VLOOKUP(A2,CSV!$H$2:$K$100,4,0)

formula searching value of A2 in CSV!H2:H100 and if found, returns corresponding value from column K . CSV!H2:H100搜索A2公式值,如果找到该值,则从K列返回相应的值。 If nothing found, it returns #N/A! 如果未找到任何内容,则返回#N/A! error. 错误。 However you can handle this case. 但是,您可以处理这种情况。
For Excel 2007 and later: 对于Excel 2007和更高版本:

=IFERROR(VLOOKUP(A2,CSV!H2:K100,4,0),"nothing found")

For Excel 2003: 对于Excel 2003:

IF(ISERROR(VLOOKUP(A2,CSV!H2:K100,4,0)),"nothing found",VLOOKUP(A2,CSV!H2:K100,4,0))

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

相关问题 如果A列包含x AND B列包含y然后添加值 - If column A contains x AND column B contains y THEN add value 在A列中查找值X的行,并在B列的同一行中插入值Y - Finding row of value X in column A, and inserting value Y in the same row, in column B 在行X和列Y的交点处粘贴值 - Pasting value at the intersection of Row X and Column Y 如果 X 列包含值,则将 Y 列值添加到工作表范围 - If column X contains value, add column Y value to worksheet range 在第 1 列中找到相同的值,如果第 2 列中的所有值都是 X,则在第 3 列中给出 Y - Find same value in column 1, if all values are X in column 2, give Y in column 3 Excel-在X列中查找最后一个相同的值,并将Y列添加到当前单元格 - Excel - Find last same value in Column X and add Column Y to current cell Excel - 检查值 X 和值 Y 是否在同一行 - Excel - Check if value X and value Y is on the same row Excel:如果列中的单元格= X的文本值,则在另一个工作表上显示文本(在同一行,但不同的列) - Excel: If Cell in Column = text value of X, then display text (in the same row, but different column) on another sheet 如果 X 然后在同一行中查找 Y (Excel) - If X then look for Y in same row (Excel) VBA在A列中找到x值,在B列中找到y值,在C列中找到和值 - VBA find value x in column A and value y in column B and sum values in column C
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM