#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Sorting Numbers

I use exel to keep track of IP addresses. How do I sort on a column so the
numbers will be decending I use text or general and it will put
1,11,12,13...2,20,21 and so on. Would like to have it sort 1,2,3,4, and so on.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Sorting Numbers

IP addresses are not numbers.

They are text and sort like text which is not the same as number sorting.

You must extract part of the IP into another column and sort on that column.


Gord Dibben MS Excel MVP

On Tue, 26 Feb 2008 13:13:02 -0800, Donbo
wrote:

I use exel to keep track of IP addresses. How do I sort on a column so the
numbers will be decending I use text or general and it will put
1,11,12,13...2,20,21 and so on. Would like to have it sort 1,2,3,4, and so on.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Sorting Numbers

Data/ Text to Columns ... may be a handy way of splitting up the IP text
into separate columns which can be treated as numbers.
--
David Biddulph

"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
IP addresses are not numbers.

They are text and sort like text which is not the same as number sorting.

You must extract part of the IP into another column and sort on that
column.


Gord Dibben MS Excel MVP

On Tue, 26 Feb 2008 13:13:02 -0800, Donbo

wrote:

I use exel to keep track of IP addresses. How do I sort on a column so the
numbers will be decending I use text or general and it will put
1,11,12,13...2,20,21 and so on. Would like to have it sort 1,2,3,4, and so
on.




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Sorting Numbers

On Tue, 26 Feb 2008 13:13:02 -0800, Donbo
wrote:

I use exel to keep track of IP addresses. How do I sort on a column so the
numbers will be decending I use text or general and it will put
1,11,12,13...2,20,21 and so on. Would like to have it sort 1,2,3,4, and so on.



You have to convert the IP addresses into numbers, and then sort on that. You
can do this with a formula in a "helper column" adjacent to your table. Then
you sort on the helper column. You can hide (or delete) the helper column.

A worksheet formula to convert your IP address in C1 into a number is:

=TEXT(LEFT(C1,FIND(".",C1)),"000")&TEXT(MID(C1,FIN D(".",C1)+1,FIND(CHAR(1),
SUBSTITUTE(C1,".",CHAR(1),2))-FIND(".",C1)),"000")&TEXT(MID(C1,FIND(CHAR(1),
SUBSTITUTE(C1,".",CHAR(1),2))+1,FIND(CHAR(1),SUBST ITUTE(C1,".",CHAR(1),3))-
FIND(CHAR(1),SUBSTITUTE(C1,".",CHAR(1),2))),"000") &TEXT(RIGHT(C1,LEN(C1)-
FIND(CHAR(1),SUBSTITUTE(C1,".",CHAR(1),3))),"000")

OR, you can download and install Longre's free morefunc.xll add-in from
http://xcell05.free.fr/morefunc/english and use this shorter **ARRAY**
formula:

=MCONCAT(TEXT(REGEX.MID(C1,"\d+",ROW($1:$4)),"000" ))

To enter and **ARRAY** formula you must hold down <ctrl<shift while hitting
<enter. Excel will place braces {...} around the formula.
--ron
Reply
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
Sorting of numbers ekkeindoha Excel Discussion (Misc queries) 4 October 30th 07 10:59 AM
Sorting high numbers from low numbers between two rows scotty New Users to Excel 7 February 12th 07 09:38 PM
Sorting - cells containing numbers, numbers and letters Gunny Excel Discussion (Misc queries) 5 July 16th 06 01:22 AM
Sorting numbers with differing numbers of digits Trudy Excel Discussion (Misc queries) 5 March 4th 06 12:31 PM
sorting the row by numbers Jen Excel Worksheet Functions 0 January 12th 05 06:55 AM


All times are GMT +1. The time now is 03:38 PM.

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"