Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a problem in sorting the excel spreadsheet in a row that contain value in number+string format. I have a data in the following sequence

work10, work11, work12, work1 and work2

I want to sort the data into the following sequence:

 work1, work2, work10, work11 and work12
share|improve this question

migrated from stackoverflow.com Oct 17 '12 at 11:33

This question came from our site for professional and enthusiast programmers.

Because your data is strings, it is sorted according to text sort order. To sort as you want, either pad the numbers with leading zero's, or split into seperate components, sort on the number part then reassemble the strings

share|improve this answer

You must log in to answer this question.