Home |
Search |
Today's Posts |
#7
![]() |
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sort Ascending button - Excel 2003 | Excel Discussion (Misc queries) | |||
How do I sort a column of data and have each data row sort accordi | Excel Discussion (Misc queries) | |||
"-" ignored in sort | Excel Discussion (Misc queries) | |||
Excel Sort function should not sort the cell formatting! | Excel Worksheet Functions | |||
Data > Sort function amnesia? | Excel Discussion (Misc queries) |