We have discussed about VLOOKUP in our previous posts and talked about how it could help us in extracting data from the tables. In this tutorial we will learn about Joining Data from Tables in EXCEL using VLOOKUP
For this, we will be making two example tables, both of which resides in different sheets named Company and Products respectively.
Our sample data for both the tables are:
TABLE 1:
TABLE 2:
Now, our goal is to print the name of the company which makes the listed prodcuts according to the Comp_ID.
(if you know about DBMS, you could relate the Comp_ID as the foreign key for table Product and the ID as the Primary key for the table Company)
How to Join?
Joining Data from Tables in EXCEL using VLOOKUP
Steps:
- On sheet named product click on C2 cell
- Go to the Formula tab -> Click on Insert Function
- A dialog will appear,
Here, select the category as Lookup & Reference -> Under select a function, scroll down and select VLOOKUP and click on OK.
- Again, a dialog box appears asking to enter the Function Arguments:
Give the above arguments and click on OK
- After doing the last step, you’ll observe that your first entry of the Product table has been updated with the Company name.
- To apply to all the relevant cells, use auto fill feature.
Now we got out desired result.
Note: These values are coming from a different table of a different sheet and we were able to join the two tables using VLOOKUP.
Else,
You can just give the below formula into the first entry and copy it to relevant cells:
=VLOOKUP(A2,Company!A:B,2,FALSE)
You can customise the above formula and the function arguments to extract relevant data according to your work needs.
Hope you have understood how to join data using VLOOKUP function.
Keep Learning!