ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sort IP address. (https://www.excelbanter.com/excel-programming/321957-sort-ip-address.html)

Dogwoodz

Sort IP address.
 
I need to sort IP addresses. I capture data from a program and put then in
Excel. I need to be able to insert leading zeros in the sections that have
less than 3-digits. IP address "123.123.123.3". If sorted "123.123.123.254"
comes before "123.123.123.3".

Tom Ogilvy

Sort IP address.
 
This Topic has been discussed many times. See this listing and see what you
like:

http://groups.google.co.uk/groups?as...el.*&lr=&hl=en

--
Regards,
Tom Ogilvy

"Dogwoodz" wrote in message
...
I need to sort IP addresses. I capture data from a program and put then

in
Excel. I need to be able to insert leading zeros in the sections that

have
less than 3-digits. IP address "123.123.123.3". If sorted

"123.123.123.254"
comes before "123.123.123.3".




Mike Fogleman

Sort IP address.
 
Here is a trick that doesn't require the leading zeros. You will need 5
empty columns to the right of the IP column. If IPs are in column A copy
them to column B. Select the IP list in column B. From the menu select
Data/Text to Columns. Tell the Import Wizard "Delimited" and for the
separator Other type "." (decimal without the quotes). This will create 4
columns with 1 number each from the IP. Now select the entire block of data
(columns A:E) and from the menu select Data/Sort and choose column E -
Ascending. Now you can delete columns B:E, leaving column A sorted
correctly.

Mike F

"Dogwoodz" wrote in message
...
I need to sort IP addresses. I capture data from a program and put then in
Excel. I need to be able to insert leading zeros in the sections that
have
less than 3-digits. IP address "123.123.123.3". If sorted
"123.123.123.254"
comes before "123.123.123.3".





All times are GMT +1. The time now is 12:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com