Matching 2 datas (vlookup?)

Gotchaman

New Member
Joined
Jul 15, 2011
Messages
25
I have to compare records from 2 different database. Examples below. I need to compare them based on barcode and see if their locations are different from database 2. If they match, then it says "Yes." If not, it returns the location from the db2. If it cannot find a barcode in the database 2, then it should return a value something like "not found." How do I do this?
Excel Workbook
ABCDEF
1Database 1Database 2
2Bar CodeLocationBar CodeLocation
3090001141131101A018090001141131101A018
4017025743001101A024017025743001101A024
5017033021001101A040017033021001101A040
6017069637001101A093011000346001115B006
7017189535401101B002011000407001115D116
8018622294001101C046011000822001107H062
...

The output should look something like this:
Excel Workbook
ABCDEFG
1Database 1Database 2
2Bar CodeLocationMatch?Bar CodeLocation
3090001141131101A018Yes090001141131101A018
4017025743001101A024Yes017025743001101A024
5017033021001101A040Yes017033021001101A040
6017069637001101A093115B006 011000346001115B006
7017189535401101B002115D116011000407001115D116
8018622294001101C046Not found011000822001107H062
...
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Try

Excel Workbook
ABCDEFGH
11Database 1Database 2
22Bar CodeLocationMatch?Bar CodeLocation
3390001141131101A018Yes90001141131101A018
4417025743001101A024Yes17025743001101A024
5517033021001101A040Yes17033021001101A040
6617069637001101A093115B00611000346001115B006
7717189535401101B002115D11611000407001115D116
8818622294001101C046Not found11000822001107H062
917069637001115B006
1017189535401115D116
Sheet1
Excel 2002
Cell Formulas
RangeFormula
D3=iferror(IF(VLOOKUP(B3, $G$3:$H$19, 2, FALSE)=C3, "Yes", VLOOKUP(B3, $G$3:$H$19, 2, FALSE)), "Not found")
 
Upvote 0
Try this in D3

=if(ISERROR(VLOOKUP(B3,$G$3:$H$19,2,0)),”Not Found”,IF(VLOOKUP(B3,$G$3:$H$19,2,0)=C3,”Match”, VLOOKUP(B3,$G$3:$H$19,2,0)))
 
Upvote 0
C3, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IF(ISNUMBER(MATCH(B3,IF($E$3:$E$8=A3,$F$3:$F$8),0)),"Yes",
    VLOOKUP(A3,$E$3:$F$8,2,0))
 
Upvote 0
Try this in C3, was referencing the other reply.
=IF(ISERROR(VLOOKUP(A3,$E$3:$F$8,2,0)),"Not Found",IF(VLOOKUP(A3,$E$3:$F$8,2,0)=B3,"Match",VLOOKUP(A3,$E$3:$F$8,2,0)))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,506
Messages
6,179,159
Members
452,892
Latest member
yadavagiri

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top