Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / July 2007

Tip: Looking for answers? Try searching our database.

sorting logical lists

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
leonliev@gmail.com - 11 Jul 2007 13:24 GMT
hi everybody,

my question is as follows, i'll try to explain it using a current
situation I've had.

I've created a semi-numerological list (numbers with other
characters), consisting of the following data:

60000-1
60000-2
60000-3
60000-4
60000-5
60000-6
60000-7
60000-8
60000-9
60000-10
60000-11
60000-12

If you let excel sort this dataset (even if you format the cells as
numbers), it sorts as follows:

60000-1
60000-10
60000-11
60000-12
60000-2
60000-3
60000-4
60000-5
60000-6
60000-7
60000-8
60000-9

Is there a way to let excel sort this dataset correctly (as the top
list, that means)?

thanks in advance,
Leon van Gurp
Jon Skeet [C# MVP] - 11 Jul 2007 13:26 GMT
On Jul 11, 1:24 pm, leonl...@gmail.com wrote:

<snip>

> Is there a way to let excel sort this dataset correctly (as the top
> list, that means)?

That sounds like a question for an Excel newsgroup really... have you
tried asking there?

Jon
Ignacio Machin ( .NET/ C# MVP ) - 11 Jul 2007 15:16 GMT
Hi,

> hi everybody,

> Is there a way to let excel sort this dataset correctly (as the top
> list, that means)?

Is this in excel ?
IF so you are in thr wrong group.

Post back if you are really doing this in C#
Nicholas Paldino [.NET/C# MVP] - 11 Jul 2007 16:41 GMT
As others have pointed out, this is an excel question, and you would
probably have better luck in an Excel group.

   However, this is a general problem-solving issue.  Excel is not doing
the incorrect thing here, since it knows nothing about the format of your
string.  It just knows it is text and tries to sort it accordingly.

   What you want to do is have two calculated columns, one with the number
on the left, and another with the number on the right.  Then, you sort based
on the first number, then the second.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

> hi everybody,
>
[quoted text clipped - 38 lines]
> thanks in advance,
> Leon van Gurp

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.