+ Reply to Thread
Results 1 to 8 of 8

Formula to sort data

  1. #1
    Forum Contributor
    Join Date
    09-19-2007
    Posts
    115

    Formula to sort data

    i would like to create a formula to be placed in column b that sorts data in column a.

    i've attached an example worksheet to show how the data should be sorted.

    a helper column containing "A1, A2 etc" may be helpful, yet i'm unsure how to sort alpha-numeric results. there are also numeric results (eg 12, 13).

    thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    =IF(ISNUMBER(LEFT(A2,2)+0),"z"&LEFT(A2,2),LEFT(A2,2))
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Contributor
    Join Date
    09-19-2007
    Posts
    115
    thanks VBA Noob.

    that's helpful for the helper cell, but what formula can be used to sort the data into order?

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Formula don't sort

    Add my formula to Col B and then use excel sort

    VBA Noob

  5. #5
    Forum Contributor
    Join Date
    01-05-2004
    Location
    Helsinki, Finland
    Posts
    100
    Hi,

    this uses two helper columns, but it also sorts the data.

    - Asser
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    09-19-2007
    Posts
    115
    thanks jazzer. that formula looks very helpful! may i ask why you need the first helper column?

  7. #7
    Forum Contributor
    Join Date
    01-05-2004
    Location
    Helsinki, Finland
    Posts
    100
    You're welcome.

    That's just because you wanted to sort so that the numbers comes after letters. Normally if you sort in Excel, the numbers comes first. That's why I add an extra ! before any letters, because ! is "smaller" than any number.

    - Asser

  8. #8
    Forum Contributor
    Join Date
    09-19-2007
    Posts
    115
    thanks jazzer. you're a star!

+ 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