Sort IP addresses

PerfectTommy

New Member
Joined
Apr 8, 2002
Messages
15
I need to sort a range of IP addresses. The problem I am having is this:

xxx.xxx.xxx.1
xxx.xxx.xxx.2
xxx.xxx.xxx.11

sorts as

xxx.xxx.xxx.1
xxx.xxx.xxx.11
xxx.xxx.xxx.2

how can I fix this?

I appreciate any help. Thank you.

Tommy
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Thanks for the reply, Von Pookie.

I actually looked at that topic before I posted, but according to Mark W. (if I am reading this correctly) that solution actually does not work.

Any other thoughts/suggestions?

Thanks
 
Upvote 0
If your list is in column A, type this formula in B1 and copy down:

=VALUE(RIGHT(A1,LEN(A1)-12))

and then sort on column B

does it help?

(the "12" at the end is the number of characters before the changing part of the address: "xxx.xxx.xxx." you may have to adjust it to your needs)
 
Upvote 0
I've never actually tried that myself, but Mark also links to another post on the same topic. As far as I understood, he was just saying that the formula that Aladin posted there wouldn't work.

Other than pointing you in that direction, I personally can't really help, sorry.
blush.gif


_________________<font color="#3399FF" size="3">Kristy</font>
kitten_smush2.jpg

This message was edited by Von Pookie on 2002-10-04 13:16
 
Upvote 0
try:

=RIGHT(A1,4-FIND(".",RIGHT(A1,4)))+0

where A1 is the first number.
Then sort on that.
 
Upvote 0
Also,

what happens in this case:
Book1
ABCD
1155.113.206.66
294.205.48.66
3135.186.99.1010
4128.248.247.1212
5172.205.61.1616
6236.53.229.1717
759.147.49.2020
8156.127.39.2727
993.129.157.3131
1059.7.230.4444
11188.251.24.4444
12253.237.87.4545
1321.84.97.5454
1490.240.159.5454
15254.175.217.5555
16183.58.166.6565
17187.15.98.6767
18178.236.176.7171
19252.166.18.7373
20149.61.161.7474
Sheet1
 
Upvote 0
Ian Mac,

Thank you. Your formula works perfectly for what I asked for. Unfortunately, (and I think you guessed this from your second post) I did not ask for the right thing...

The IP addresses I need to sort actually have this pattern:

xxx.xxx.yyy.zzz

Do you perhaps have something that will sort the addresses according to the "yyy" set, and then the "zzz" set?

I apologize for the mistake.

Thank you (everyone) for your help.
This message was edited by PerfectTommy on 2002-10-04 13:26
 
Upvote 0
1. Your IP addresses starting in A1

2. In B1 =LEFT(A10,11) copy down (to produce xxx.xxx.xxx)

3. In C1 uses Ian's formula (copy down).

4. Sort on Column C.

5. For columns B and C, copy/paste special/values to strip away the formulas.

6. In D1 = B1&"."&C1 copy down.

Regards,

Mike
 
Upvote 0

Forum statistics

Threads
1,222,383
Messages
6,165,661
Members
451,983
Latest member
Raph24

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