Changing Domain names

briansterling

New Member
Joined
Aug 10, 2017
Messages
2
So I'm migrating a multitude of workstations from one domain to another and I have a very useful program to help me with this. One of the great features is it can draw from an excel file to rename the computers in the same process which is necessary since the new domain has different naming standards than we have now. Can anyone help me understand the formula/conditional formatting necessary to produce the type of results in the example table below?

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Old Domain Name[/TD]
[TD]New Domain Name[/TD]
[/TR]
[TR]
[TD]LOC(ation)5001(item ID)[/TD]
[TD]USLOC-LT-05001[/TD]
[/TR]
[TR]
[TD]LAP5549[/TD]
[TD]USTUS-LT-05549[/TD]
[/TR]
[TR]
[TD]SUR5112[/TD]
[TD]USTUS-LT-05112[/TD]
[/TR]
[TR]
[TD]CHA2745[/TD]
[TD]USCHA-LT-02745[/TD]
[/TR]
[TR]
[TD]CAR2786[/TD]
[TD]USCAR-LT-02786[/TD]
[/TR]
</tbody>[/TABLE]

I would need a way to:
- Isolate the last 4 numbers and add a zero
- Take the first three letters and make bring them over after inserting "US"
*but not if the three letters are "LAP"
- Insert the "-LT-0" between the location and the inventory number.

With how our names are now the results are bound to be quite messy but it would save a lot of time in giving me a base-line that I can go through and make corrections after the fact. I appreciate any assistance that is provided.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
How do you get these?

LAP5549 USTUS-LT-05549
SUR5112 USTUS-LT-05112

Otherwise,

[Table="width:, class:grid"][tr][td="bgcolor:#C0C0C0"][/td][td="bgcolor:#C0C0C0"]
A​
[/td][td="bgcolor:#C0C0C0"]
B​
[/td][td="bgcolor:#C0C0C0"]
C​
[/td][/tr][tr][td="bgcolor:#C0C0C0"]
2​
[/td][td]LAP5549[/td][td="bgcolor:#E5E5E5"]USLAP-LT-05549[/td][td]B2: ="US" & LEFT(A2, 3) & "-LT-0" & RIGHT(A2, 4)[/td][/tr]
[tr][td="bgcolor:#C0C0C0"]
3​
[/td][td]SUR5112[/td][td="bgcolor:#E5E5E5"]USSUR-LT-05112[/td][td][/td][/tr]
[tr][td="bgcolor:#C0C0C0"]
4​
[/td][td]CHA2745[/td][td="bgcolor:#E5E5E5"]USCHA-LT-02745[/td][td][/td][/tr]
[tr][td="bgcolor:#C0C0C0"]
5​
[/td][td]CAR2786[/td][td="bgcolor:#E5E5E5"]USCAR-LT-02786[/td][td][/td][/tr]
[/table]
 
Upvote 0
- Take the first three letters and make bring them over after inserting "US"
*but not if the three letters are "LAP"
Based on your example...

Are we supposed to conclude that if the first three letters are "LAP", they should be changed to "TUS" before the "US" is placed in front of them?

Why are the first three letters "SUR" changed to "TUS" before the "US" is placed in front of them?
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,313
Members
452,634
Latest member
cpostell

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