Combining data from multiple worksheets

gwong

New Member
Joined
Mar 14, 2013
Messages
1
Hi,

I was wondering if I could get some help on how to combine data from multiple worksheets. Here is an example of what I am trying to accomplish:

Worksheet1 contains the following data:
NameColour
JohnBlue
KevinGreen
AnneRed
JenPink

<colgroup><col style="width:48pt" span="2" width="64"> </colgroup><tbody>
</tbody>


Worksheet2:
NameFruit
JackApple
KevinBanana
AnneApple
RichardOrange
ChristineKiwi
JenOrange
JohnGrapes

<colgroup><col style="width:48pt" span="2" width="64"> </colgroup><tbody>
</tbody>


I would like to grab the fruit data from Worksheet2 and add it to a new column in Worksheet1 for only the names specified in Worksheet1. Basically the logic I am trying to get at is, search through the Name column in Worksheet2 for the same names as in Worksheet1, then add the corresponding fruit values to Worksheet1. What kind of formula could I use for this?

Correct output should be:
NameColourFruit
JohnBlueGrapes
KevinGreenBanana
AnneRedApple
JenPinkOrange

<colgroup><col style="width:48pt" span="3" width="64"> </colgroup><tbody>
</tbody>


This is of course an extremely simplified example, the real data that I am using contains thousands of lines, but the idea is still the same. So my question is, what formula could I use for column C in Worksheet1 that can compare the name values in Worksheet1 with the name values in Worksheet2, and if they are the same, grab the fruit value corresponding to that name and add it to the column C? Any help would be greatly appreciated it.

Thank you,
Gavin
 
Last edited:

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
If your values a unique...

Sheet1

*ABC
1NameColourFruit
2JohnBlueGrapes
3KevinGreenBanana
4AnneRedApple
5JenPinkOrange

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
C2=VLOOKUP(A2,Sheet2!$A$2:$B$8,2,FALSE)

<tbody>
</tbody>

<tbody>
</tbody>


Sheet2

*AB
1NameFruit
2JackApple
3KevinBanana
4AnneApple
5RichardOrange
6ChristineKiwi
7JenOrange
8JohnGrapes

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:64px;"><col style="width:64px;"></colgroup><tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 
Upvote 0

Forum statistics

Threads
1,215,452
Messages
6,124,916
Members
449,195
Latest member
Stevenciu

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