+ Reply to Thread
Results 1 to 6 of 6

sorting problem in excel 2003 - 2007

  1. #1
    Registered User
    Join Date
    01-14-2008
    Posts
    7

    sorting problem in excel 2003 - 2007

    I have a spreadsheet for work that consists of various columns of data. One important sorting column would be Job #. Inside this coulumn are data like 134-Q and 2355-P and 755-P for example. The sort now is like posted. I would like to be able to sort by both alphabetical and numerical order. ie, 755-P, 2355-P, then 134-Q. can someone help?
    Last edited by NBVC; 03-11-2009 at 02:06 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: sorting problem in excel 2003 - 2007

    Add a helper column that re-arranges the data so that the letters are first and then sort the table based on that column (which can be hidden, if desired)

    The helper column would use formula like:

    =MID(A1,FIND("-",A1)+1,10)&LEFT(A1,FIND("-",A1)-1)

    where A1 contains first code to rearrange
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    01-14-2008
    Posts
    7

    Re: sorting problem in excel 2003 - 2007

    I appreciate the quick response. I do not have much experience with these helper columns or how they actually work. I entered the formula in a blank column, let's say position A2. My data is in coulmn B. I copied A1 over the entire column B. Then I sorted the coulmn. The results did not produce the desired results. I probably need further assistance. Thanks to all who might help.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: sorting problem in excel 2003 - 2007

    You know, testing this again... I think it wouldn't work right... you are correct...

    instead you will need 2 helper columns... one to extract the letter and one to extract the number, then sort by letter column first and number column second...

    so formula in B1: =MID(A1,FIND("-",A1)+1,10)
    and formula in C1: =LEFT(A1,FIND("-",A1)-1)+0

    both copied down.

    Then sort by column B first, column C second.

    See attached... the file is not yet sorted.. click on any occupied cell and go to Data|Sort to do your sorting.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-14-2008
    Posts
    7

    Re: sorting problem in excel 2003 - 2007

    Thanks very much, it worked well. Another situation, I might need a class at a local college!

    I have a similar spreadsheet with columns of info from a-x. in column A there are part numbers like: RH630-34, PH630-343, 6-255, 16-01, 72500, etc....
    I need to sort them so the order would be numbers first and combo with number letters next. finish product: 6-255, 16-01, 72500, PH630-343, RH630-34. Is this possible? Is there a limitation to the amount of digits a number or combo can have? Will the original post scenario work for this as well.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: sorting problem in excel 2003 - 2007

    Please start a new thread with your new question.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1