Prev Previous Post   Next Post Next
  #7   Report Post  
JC
 
Posts: n/a
Default

George,

This might be an easier solution for you.

I have a column C containing the data in the form
Source:61.53.154.89, 48725, WAN -
that I want to sort on.

I set up helper columns J to N as follows:-
J1 = IF($A1="","",FIND(":",$C1))
K1 = IF($A1="","",FIND(".",$C1))
L1 = IF($A1="","",FIND(".",$C1,$K1+1))
M1 = IF($A1="","",FIND(".",$C1,$L1+1))
N1 = IF($A1="","",FIND(",",$C1))

and used these helper columns to create 2 sort columns H and I as follows:-
H1 =IF($A1="","",1000*MID($C1,$J1+1, $K1-$J1-1) +MID($C1,$K1+1, $L1-$K1-1))
I1 =IF($A1="","",1000*MID($C1,$L1+1, $M1-$L1-1) +MID($C1,$M1+1, $N1-$M1-1))
which are used for the actual sorting. Columns H and I end up with
H1 = 61053 and
I1 = 154089
respectively.

Simply select columns H to N in row 1, click on the cross on the bottom RHS of
the selection and then drag it down until you reach the end of the data or to
row 10000 as desired. Then select the full set of data - say columns A to G
from row 1 to say 10000 and sort on columns H and I.

This will sort as you want.

JC

On Wed, 15 Jun 2005 08:09:02 -0700, "George Wilson"
wrote:

I needed to turn this around quickly yesterday so I used the "text to column"
separated by "." Since I will be maintaining IP addresses in the future I
will look into the macro sort options. Thank you all for your assistance.
George

"George Wilson" wrote:

I have a spreadsheet I would like to sort by IP address. I have a format
192.168.2.1 but excel recognizes the next address as 192.168.2.10 then
192.168.2.100. I do not have leading zeros so I have been unsuccessfull
parsing the data using LEFT and RIGHT functions and sorting that way. Can I
divide the data by "."? is that necessary to accomplish the proper sort?
TIA
George


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort Ascending button - Excel 2003 Ann Scharpf Excel Discussion (Misc queries) 0 May 23rd 05 11:11 PM
How do I sort a column of data and have each data row sort accordi Oedalis Excel Discussion (Misc queries) 1 March 17th 05 11:52 PM
"-" ignored in sort Mike H Excel Discussion (Misc queries) 8 January 2nd 05 07:48 AM
Excel Sort function should not sort the cell formatting! Lisa D.N.1 Excel Worksheet Functions 1 December 28th 04 08:37 PM
Data > Sort function amnesia? Dave D Excel Discussion (Misc queries) 1 November 29th 04 10:44 PM


All times are GMT +1. The time now is 01:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"