+ Reply to Thread
Results 1 to 3 of 3

Excel 2007 : Alphanumeric sorting

  1. #1
    Registered User
    Join Date
    10-11-2010
    Location
    Missouri, USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Alphanumeric sorting

    Hello, I need to sort a column of data that's alphanumeric. It's the volume numbers for my library's *** collection

    It's the following type of data: [Letter for genre][number from 1-999][occasional suffix letter]

    I'd like it to sort like this:
    A1
    A2
    A3
    A3a
    A3b
    A4
    ...
    A157
    B1
    B2
    ...
    etc.

    Unfortunately, right now it's sorting like this:
    A1
    A10
    A100
    A101
    ...

    I saw another post that solved this same problem by inserting zeroes before the 1 and 2 digit numbers. Unfortunately, I've got about 1400 cells, so manually doing that is not an option.

    I'm pretty low on skill when it comes to formulas and programming, so a solution that would be simple to implement would be preferred. Thanks!
    Last edited by Ethan Cordray; 10-11-2010 at 12:27 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Yet another alphanumeric sorting question

    Assuming those strings are in column A starting at A1:

    1) Put this formula in an empty column and copy down:
    =IF(ISNUMBER(RIGHT(A1)+0), LEFT(A1,1) & TEXT(MID(A1,2,LEN(A1)),"000"), LEFT(A1,1) & TEXT(MID(A1,2,LEN(A1)-2),"000") & RIGHT(A1))

    2) Highlight all the formulas you created

    3) Ctrl-C to copy them

    4) Select Edit > Paste Special > Values

    5) Now copy the values again and paste them over the original values in column A.

    6) Remove the values from the column you added

    7) You can now sort the data by the newly created standardized text strings.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    10-11-2010
    Location
    Missouri, USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Alphanumeric sorting

    Thanks, that worked perfectly!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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