Changing IP Addresses

t2true

New Member
Joined
Dec 2, 2015
Messages
36
Office Version
  1. 2016
Platform
  1. Windows
I need to change the IP addresses of some servers to a different network, but I want to retain the last octet. They are in the 192.168.1.0 network and need to be changed to the 10.0.0.0 network.

How can I either replace the first three octets or extract the last octet in order to the change the IPs? (Each octet may be different character lengths.)

192.168.1.120 >> 10.0.0.120
192.168.1.143 >> 10.0.0.143
192.168.1.92 >> 10.0.0.92
192.168.1.4 >> 10.0.0.4
192.168.1.5 >> 10.0.0.5

Thanks
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Try this, for an entry in cell A1:
Excel Formula:
="10.0.0." & TRIM(RIGHT(SUBSTITUTE(A1,".",REPT(" ",100)),100))
 
Upvote 0
Solution
That worked perfect! Thank you.

If not too much trouble, any way you can explain how it works so I understand it?
 
Upvote 0
You are welcome.

It is easiest to follow if we break this into two parts. First, we are taking the hard-coded string "10.0.0."

In the second part, we are replacing each period in thr original value with 100 spaces.
Then we are taking the right most 100 characters of that, which will give us our last value after the last period, and a bunch of spaces.
The TRIM function removes all the spaces, so we are just left with the value.

Then we just combine parts one and two.
 
Upvote 0

Forum statistics

Threads
1,215,491
Messages
6,125,104
Members
449,205
Latest member
ralemanygarcia

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