I have two sheets in my excel file. The first one looks like this:
**Name** **Code**
Bob ??
Thomas ??
Rob ??
The second one looks like this:
**Name** **Code**
Thomas tom
James jam
Bob bob
What I want to do is for each name is sheet 1, search in sheet 2 for the correct code and add the code in column two of sheet 1. How would I proceed?
Thanks in advance
Assuming those start at A1 in both sheets, put this formula in
B2on sheet 1:This takes the value from
A2, goes to the range referenced byA2:B4on the other sheet (the dollar signs make sure the range doesn’t change when you drag/copy the formula), finds the corresponding value and then pulls the value from the column next to it.Make sure that
Sheet2actually matches your sheet name. One way to make sure this happens is to start typing the formula and then manually select the range from the table. Once you have selected it, pressF4to quickly change it to an absolute range (which is what the dollar signs mean).