+ Reply to Thread
Results 1 to 6 of 6

2 Column sorting question

  1. #1
    Registered User
    Join Date
    01-10-2008
    Posts
    6

    2 Column sorting question

    Hello,

    (I did a search on subsort and on sort, and didn't quite find what answered my question)

    I have a spread sheet with lots of columns. I need to sort column A. No problems there. but I need to subsort column B .

    PO Cust Item (column B)
    4500025611 R518851
    4500089149 R518437
    4500089149
    4500089152 R86007-E
    4500089152 R86007-E
    4500107827 R86007-E
    4500107827 R518436-F
    4500107827 R518436-F
    4500107827 R518851-G
    4500107828 R86007-E
    4500107828 R86007-E
    4500107828 R86007-E
    4500108239 R86007-E
    4500109038 R86007-E
    4500110406 R86007-E
    4500113438 R518851-G
    4500113439 R86007-E
    4500113439 R505626-B
    4500113440 R86007-E


    I can't for the life of me figure this out, could anyone shed some light on this please?

    Thanks much for looking and any help.

    I removed from the other forum.

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    You need a few helper columns with this one to extract the number in B to do the second sort.

    Select all the data A2:F20, then sort by A then by F
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Registered User
    Join Date
    01-10-2008
    Posts
    6
    Thanks chippy. It appears you have been around awhile and helped out lots of people.
    While I don't have the knowledge in this area to help anyone, if the site takes donations, I would be happy to make one for you and all the people who help out here :-)




    I am not sure I understand the answer (I kind of do)

    The data starts in row 2 and goes to row 821
    The columns start in A and go to P

    It is currently sorted by column A and I cut and pasted to get column B next to A so that they were side by side (for easier reading) I got lost on the helper column part and what it was I was supposed to do.

  4. #4
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi cwg,

    All the help here is free, so it doesn't matter how many questions you have, there's always someone willing to offer an answer. If you can think of something you want to do in Excel, chances are someone will know how to do it - one way or another!

    Right your data is in Row 2 down to row 821 - OK, insert five columns next to column A.

    Now copy and paste your data you need next to B (for easier reading)

    Copy the formulas from my example C2:F2 into row 2. You should now have the number (extracted) from B2 in F2. (If you haven't something is wrong)

    Now select C2:F2 and autofill down the columns - the quickest way - with C2:F2 selected is to double-click on the little black square in the bottom right of cell F2. You should now have all 821 rows full.

    Now select ALL of the rows from A2 to A821, go to Data > Sort and sort by column A then by column F. If you are now happy that the data is sorted correctly, you can now delete columns B:F.

    You are now left with your original data, but sorted in the order you want - hopefully!

  5. #5
    Registered User
    Join Date
    01-10-2008
    Posts
    6
    Thanks for the help oldchippy :-)


    I had to take it to kinkos to get it printed and someone new was there (well new to me)

    I was trying to go over the directions and this was suggested. Please in your opinion let me know if this is a proper way to sort or if it is just moving data in 2 columns

    1. Highlight the entire document
    2. Go to sort and fill
    3. Select custom sort
    4. Use the first drop down menu (labeled sort by) and select PO
    5. Click the Add Level Button (which brings up another line called "then by"
    6. Use the "then by" drop down menu to select "order"
    7. Click OK

    What I am worried about is that while it seems it may sort both A and B, I'm worried that it may not move the correlated data accordingly from the other columns.

    Any comments or opinions?

    Thanks

  6. #6
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    From your discription you are using 2007 (are you?) and yes it is OK and will retain the data in the other columns with its associated data when it does the sort.

    I can't see all of your data, only the sample you have posted, so I wasn't sure whether that when you have duplicate numbers in column A, whether the associated data in column B was in numerical order or not?

    For example there are two in your data like so

    4500113439 R86007-E
    4500113439 R505626-B

    but further down the list you may have something like this

    4500113439 R505626-B
    4500113439 R86007-E

    So the method I was using would have sorted those with the smallest number in column B first like so

    4500113439 R86007-E
    4500113439 R505626-B

    Hope this all makes sense to you and I'm not making it confusing?

+ 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