+ Reply to Thread
Results 1 to 5 of 5

sorting more than 3 columns

  1. #1
    Registered User
    Join Date
    02-09-2004
    Posts
    52

    sorting more than 3 columns

    Hi,

    Does anyone know if its possible to sort data by more than the 3 criteria in the sort menu in Data>Sort?

    Preferably I need to do it on 5 columns, I can't figure it out though - Would I need to use a pivot table?

    Thanks for any help at all.

    Regards,

    saybut.

  2. #2
    Registered User
    Join Date
    02-09-2004
    Posts
    52

    sorted. (sorry!)

    Hi, sorry I've just figured out how to do it.

    Just in case anyone is interested, if you're sorting five columns, A,B,C,D,E

    sort the last three first, C,D,E and then sort A,B.


    or if anyone has any better ways let me know.

    thanks.

  3. #3
    Bob Phillips
    Guest

    Re: sorting more than 3 columns

    No, that is the way to do it.

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "saybut" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi, sorry I've just figured out how to do it.
    >
    > Just in case anyone is interested, if you're sorting five columns,
    > A,B,C,D,E
    >
    > sort the last three first, C,D,E and then sort A,B.
    >
    >
    > or if anyone has any better ways let me know.
    >
    > thanks.
    >
    >
    > --
    > saybut
    > ------------------------------------------------------------------------
    > saybut's Profile:

    http://www.excelforum.com/member.php...fo&userid=5949
    > View this thread: http://www.excelforum.com/showthread...hreadid=514329
    >




  4. #4
    Pete_UK
    Guest

    Re: sorting more than 3 columns

    Another way is to join columns together in a helper column, eg in F2
    enter the formula:

    =A2&B2&C2&D2 &E2

    copy down, and sort on this one field. The fields should be converted
    to fixed width if they are not already. If the field is text then
    spaces can be added to make it up to a fixed number of characters, and
    if it is numeric it can be made fixed width using TEXT( ). So you might
    actually have something like:

    =A2&B2&REPT(" ",20-LEN(B2))&C2&REPT(" ",10-LEN(C2))&TEXT(D2,"000")&E2

    Here A2 is already fixed width (eg code number), B2 is made up to 20
    characters, C2 is made up to 10 characters, D2 is a number fixed to 3
    characters and E2 is not changed. The advantage is only one sort is
    needed.

    Of course, this leaves two other slots in the sort dialogue box for
    further refinement.

    Hope this helps.

    Pete


  5. #5
    Registered User
    Join Date
    02-09-2004
    Posts
    52
    Thanks a lot for the posts. At the moment I'll just stick with the orignal method. Although it doesn't seem to work sort from the back to the front more than twice - maybe just me though.

    thanks again.

+ 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