简体   繁体   中英

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.
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.

I tried Vlookup, index and match, but I'm still missing a function to complete the syntax

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

I don't know what to insert instead of D

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

You can use MATCH on an array premises. 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:

{=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:

{=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.

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). You will get the next result:

例

Please, don't forget to press Ctrl + Shift + Enter when you're entering the formula on cell C1 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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