# Combining data from 2 worksheets

#### Douglas6587

##### New Member
I have worksheets in 2 separate workbooks. One contains a long list of individuals and their year-to-date production figure. Each individual is identified by a distinct number. My second sheet contains a smaller list of individuals and some additional production data which needs to be added to the first sheet. Those on the second sheet may or may not be on the first list. These individuals are also identified by a distinct number. If the individuals appear on each list, they will have the same distinct number on each list.

I currently have to go through the first list and search for each individual on the second list and manually key in the data from the second list in order to combine the numbers and calculate their total production.

Is there a way to merge or combine these lists so that I can calculate their total? Ideally I would like the data from the second sheet to appear in a new column in the row of the individual to which it belongs.

### Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi - Welcome to Mr. Excel Board.
It would be best if you could provide more info such as ranges, columns etc.

A simple VLOOKUP should solve the problem for you.

e.g. In the new column of workbook 1:
=VLOOKUP(A1,[otherworkbook.xls]Sheet1!\$A\$1:\$B\$5,2,False)

Where A1 is the unique number in Workbook 1, A1:B5 is the range in the other workbook, (2 assumes the data is in column 2:column B)

You may wish to remove the resultant errors you will ge for those IDs for which there is no match, in this case:

=if(iserror(VLOOKUP(A1,[otherworkbook.xls]Sheet1!\$A\$1:\$B\$5,2,False)),"",VLOOKUP(A1,[otherworkbook.xls]Sheet1!\$A\$1:\$B\$5,2,False))

Thanks Johnny! The VLookup worked perfectly!! I wasn't sure if that was the function to use or not and now you have saved my hours of manual work!

Thanks for the help!

Replies
2
Views
139
Replies
0
Views
151
Replies
12
Views
579
Replies
5
Views
154
Replies
1
Views
308

1,203,171
Messages
6,053,871
Members
444,691
Latest member
Breizze1313

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

### Which adblocker are you using?

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

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