简体   繁体   English

在两个Excel列上查找匹配项

[英]Find a match on two excel columns

I want to compare data between two tables on excel and get the cells that match in two columns. 我想在excel上的两个表之间比较数据,并获取两列中匹配的单元格。
ie: 即:
Look for the value from cell G9 in column A, if found the check if the value of cell J9 Equals to cell D of the row in which the first match was found. 从A列的单元格G9中查找值(如果找到),检查单元格J9的值是否等于找到第一个匹配项的行的单元格D。

I tried Vlookup, index and match, but I'm still missing a function to complete the syntax 我尝试了Vlookup,索引和匹配,但是我仍然缺少用于完成语法的函数

=IF(VLOOKUP(G9,$A$9:$D$1127,1,FALSE),IF(J9=D,"","new"),"new")

I don't know what to insert instead of D 我不知道要插入什么而不是D

Sample: https://drive.google.com/open?id=1aJZlpQ2V-bmwmS1Kwk-OIiSvXR552JJH 范例: https//drive.google.com/open?id = 1aJZlpQ2V-bmwmS1Kwk-OIiSvXR552JJH

You can use MATCH on an array premises. 您可以在阵列前提下使用MATCH If you want the number of the line when the values of G9 and J9 occur on columns A:A and D:D simultaneously, use the formula: 如果您希望同时在A:AD:D列上出现G9J9的值时的行号,请使用以下公式:

{=IFERROR(MATCH(J9,IF(A:A=G9,D:D),0),"No Match")}  

If you want to return just the word "new" in case of a valid match use: 如果您想在有效匹配的情况下仅返回单词“ new”,请使用:

{=IFERROR(IF(MATCH(J9,IF(A:A=G9,D:D),0)>0,"new",""),"")}

Don't forget to use Ctrl + Shift + Enter to place the braces on the formula. 不要忘记使用Ctrl + Shift + Enter将大括号放在公式上。

EDIT: 编辑:

Since I'm having some troubles with showing my solution, I'll be more thorough. 由于我在显示解决方案时遇到了一些麻烦,因此我会做的更彻底。 Let's imagine you have the following worksheet: 假设您有以下工作表:

例

For each row in the first table, if you want to check a match on the second table, you could place the formula 对于第一张表中的每一行,如果要检查第二张表中的匹配项,则可以放置公式

{=IFERROR(IF(MATCH(A1,IF(E:E=B1,D:D),0)>0,"new",""),"")}

on cell C1 and drag it to the end (to C22 on my example). 在单元格C1并将其拖到末尾(在我的示例中为C22 )。 You will get the next result: 您将得到下一个结果:

例

Please, don't forget to press Ctrl + Shift + Enter when you're entering the formula on cell C1 . 请不要忘记在单元格C1上输入公式时按Ctrl + Shift + Enter

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM