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