New employee numbers instead of the old numbers

sim_soul

New Member
Joined
Nov 20, 2018
Messages
2
Hi Everyone,

I am not an expert in Excel, and I have been trying to figure out how I can do this, but couldnt get to the right formula, I hope I can get the solution here.

The Case:

I have an Excel workbook which has multiple sheets of HR Information. We decided to stop dealing with the current Employee numbers and created a new Employee ID for each employee.

To do that, in the master sheet, I created a new column with new Employee IDs to replace the Older ones as the below example:

New Employee IDOld Employee ID
ST00000100402
ST00000200511
ST00000300108
ST00000400073

<tbody>
</tbody>

Now, I would like to replace any Old Employee ID in the other sheets with the new corresponding Employee ID as given in the master table above,

For example, the current dependents Insurance sheet looks like this:

Old Employee NumberDependent typeInsurance Class
00402WifeA+
00402SonA
00402DaughterA
00511WifeA+
00073SonB

<tbody>
</tbody>

I want to add a new column with a formula that goes to the master sheet, searches for the Old employee number and returns its corresponding New Employee Id. So the Dependents Insurance sheet should look like this instead:

New Employee IDOld Employee IDDependent typeInsurance Class
ST00000100402WifeA+
ST00000100402SonA
ST00000100402DaughterA
ST00000200511WifeA+
ST00000400073SonB

<tbody>
</tbody>


I hope I was able to clarify my request,

Thank you and appreciate your help
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
AB
1New Employee IDOld Employee ID
2ST000001402
3ST000002511
4ST000003108
5ST00000473

<tbody>
</tbody>
Sheet1



ABCD
1Old Employee NumberDependent typeInsurance ClassNew Employee Number
2402WifeA+ST000001
3402SonAST000001
4402DaughterAST000001
5511WifeA+ST000002
673SonBST000004

<tbody>
</tbody>
Sheet2

Worksheet Formulas Sheet2
CellFormula
D2=INDEX(Sheet1!$A$1:$B$5,MATCH(Sheet2!A2,Sheet1!$B$1:$B$5,0),1)
D3=INDEX(Sheet1!$A$1:$B$5,MATCH(Sheet2!A3,Sheet1!$B$1:$B$5,0),1)
D4=INDEX(Sheet1!$A$1:$B$5,MATCH(Sheet2!A4,Sheet1!$B$1:$B$5,0),1)
D5=INDEX(Sheet1!$A$1:$B$5,MATCH(Sheet2!A5,Sheet1!$B$1:$B$5,0),1)
D6=INDEX(Sheet1!$A$1:$B$5,MATCH(Sheet2!A6,Sheet1!$B$1:$B$5,0),1)

<tbody>
</tbody>

<tbody>
</tbody>
 
Last edited:
Upvote 0
AB
1New Employee IDOld Employee ID
2ST000001402
3ST000002511
4ST000003108
5ST00000473

<tbody>
</tbody>
Sheet1



ABCD
1Old Employee NumberDependent typeInsurance ClassNew Employee Number
2402WifeA+ST000001
3402SonAST000001
4402DaughterAST000001
5511WifeA+ST000002
673SonBST000004

<tbody>
</tbody>
Sheet2

Worksheet Formulas Sheet2
CellFormula
D2=INDEX(Sheet1!$A$1:$B$5,MATCH(Sheet2!A2,Sheet1!$B$1:$B$5,0),1)
D3=INDEX(Sheet1!$A$1:$B$5,MATCH(Sheet2!A3,Sheet1!$B$1:$B$5,0),1)
D4=INDEX(Sheet1!$A$1:$B$5,MATCH(Sheet2!A4,Sheet1!$B$1:$B$5,0),1)
D5=INDEX(Sheet1!$A$1:$B$5,MATCH(Sheet2!A5,Sheet1!$B$1:$B$5,0),1)
D6=INDEX(Sheet1!$A$1:$B$5,MATCH(Sheet2!A6,Sheet1!$B$1:$B$5,0),1)

<tbody>
</tbody>

<tbody>
</tbody>

Thanks alot Kamolga, however This seems to work perfectly well if I am using the cell is formatted as a number, but if the cell is formatted as text i.e the Old Employee number is written like this "00402" it doesnt work... Can this work with strings?
 
Upvote 0
Of course, they need to be both formated as text then. Just be careful that you don't have some with a space (you can use trim() to take them out) at begining or the end or some starting with '. If it does not work, simply put value() to work with numbers or text() to work with strings
 
Upvote 0

Forum statistics

Threads
1,215,032
Messages
6,122,770
Members
449,095
Latest member
m_smith_solihull

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