Match and insert

BingoGeorge

New Member
Joined
Feb 21, 2017
Messages
10
Hi there,

I have to sheets on excel

SHEET 1

[TABLE="width: 500"]
<tbody>[TR]
[TD]name[/TD]
[TD]ID[/TD]
[TD]Employee[/TD]
[/TR]
[TR]
[TD]JOHN[/TD]
[TD]5456456456[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]FRED[/TD]
[TD]141541546[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JANE[/TD]
[TD]13131531[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Sheet 2
[TABLE="width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Employee[/TD]
[/TR]
[TR]
[TD]5456456456[/TD]
[TD]B123123[/TD]
[/TR]
[TR]
[TD]141541546[/TD]
[TD]B565413[/TD]
[/TR]
[TR]
[TD]13131531[/TD]
[TD]B54546[/TD]
[/TR]
</tbody>[/TABLE]


What I need is a formula to have the Employee number added to Sheet 1 by matching the ID# from sheet 2.

Thank you!
****** id="cke_pastebin" style="position: absolute; top: 314px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">[TABLE="width: 500"]
<tbody>[TR]
[TD]13131531[/TD]
[/TR]
</tbody>[/TABLE]
</body>
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
This should work for you.

Code:
=VLOOKUP(B2,'SHEET 2'!$A$2:$B$4,1,0)

Put that in B2 and copy down as necessary. If your data range on Sheet 2 is larger update the $A$2:$B$4 to reflect the larger data group.
 
Upvote 0
I went based on what you typed in terms of sheet names, if you don't have a space between the word 'sheet' and the '2' then remove that space. Just update "SHEET 2" to be whatever your actual sheet name is, I think that is the issue.

If that already matches can you copy and paste in the full formula as you put it on your sheet.
 
Last edited:
Upvote 0
[TABLE="class: grid"]
<tbody>[TR]
[TD][/TD]
[TD]
A
[/TD]
[TD]
B
[/TD]
[TD]
C
[/TD]
[TD]
D
[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD]name[/TD]
[TD]ID[/TD]
[TD]Employee[/TD]
[TD]sheet1[/TD]
[/TR]
[TR]
[TD]
2
[/TD]
[TD]JOHN[/TD]
[TD]
5456456456​
[/TD]
[TD]B123123[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD]FRED[/TD]
[TD]
141541546​
[/TD]
[TD]B565413[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
4
[/TD]
[TD]JANE[/TD]
[TD]
13131531​
[/TD]
[TD]B54546[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


[TABLE="class: grid"]
<tbody>[TR]
[TD][/TD]
[TD]
A
[/TD]
[TD]
B
[/TD]
[TD]
C
[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD]ID[/TD]
[TD]Employee[/TD]
[TD]sheet2[/TD]
[/TR]
[TR]
[TD]
2
[/TD]
[TD]
5456456456​
[/TD]
[TD]B123123[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD]
141541546​
[/TD]
[TD]B565413[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
4
[/TD]
[TD]
13131531​
[/TD]
[TD]B54546[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

sheet1

c2=INDEX(Sheet2!$B$2:$B$4,MATCH(Sheet1!$B2,Sheet2!$A$2:$A$4,0)) copy down
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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