Knew this would come in handy. Following is my initial flawed attempt at answering the same
question previously, and then Harlan Grove's correction which should see you right. Use the
formula in a helper column to turn the addresses into values and then sort on that column.
Harlan Grove said:
Assuming your IP addresses start in A1 then put the following in B1 and
copy down.
=--SUBSTITUTE(A1,".","")
..
Unwise. IP addresses are 4 8-bit numbers (octets) concatenated with periods
between them. They don't always have leading zeros, meaning your approach would
only work if 1.1.1.1 always appeared as 001.001.001.001. If IP addresses could
appear without leading zeros, then you need to convert it into the 32-bit
unsigned integer that it actually represents. (Otherwise, 1.1.1.1 would appear
less than 0.0.1.100, which isn't the case.)
=INT(LEFT(A1,FIND(".",A1,FIND(".",A1)+1)-1))*2^24
+10*MOD(LEFT(A1,FIND(".",A1,FIND(".",A1)+1)-1),1)*2^16
+INT(MID(A1,FIND(".",A1,FIND(".",A1)+1)+1,256))*2^8
+10*MOD(MID(A1,FIND(".",A1,FIND(".",A1)+1)+1,256),1)
--
Public Service Announcements:
1. Don't attach files to postings in this newsgroup.
2. Learn how to snip unnecessary text from quoted material. Indiscriminate
quoting wastes more bandwidth than file attachments.