+ Reply to Thread
Results 1 to 7 of 7

Sorting alphanumerical characters sequencially.

  1. #1
    Registered User
    Join Date
    01-22-2016
    Location
    Cambridge, MA
    MS-Off Ver
    2013
    Posts
    3

    Sorting alphanumerical characters sequencially.

    Good morning,

    I have a huge project at work that needs to be done on Excel. It involves a bunch of samples, each assign an alphanumerical character from 1 to 12 using also the letters A through H. To make this more understandable, I need to sort out an entire column in the following format. (A1,B1,C1,D1,A2,B2,C2,D2,A3,B3,D3,D4....) that goes all the way to A12 to H12, Howeverm wehn i try to sort out, it gives the alphabetical option and then all my data is a mess. is there any formula to do this more easily, that does not involve retyping the information or splitting letters from numbers into two different columns? please help me. I realize it might be wicked easy to most of you techies, but im not very much computer-literate and this project is due this monday.


    Thanks a lot guys!!!!!

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Sorting alphanumerical characters sequencially.

    Here's one approach.
    With this list:
    A
    1
    A1
    2
    A2
    3
    A3
    4
    A4
    5
    B1
    6
    B2
    7
    B4
    8
    C1
    9
    C2
    10
    C3
    11
    C4
    12
    D1
    13
    D2
    14
    D3
    15
    D4

    This formula, copied down, creates sortable values
    Please Login or Register  to view this content.
    • Select A1:B15
    • Home.Sort.Custom
    ...Sort by: Column B
    ...Click: OK

    These are the results you should see:
    A
    B
    1
    A1
    101A
    2
    B1
    101B
    3
    C1
    101C
    4
    D1
    101D
    5
    A2
    102A
    6
    B2
    102B
    7
    C2
    102C
    8
    D2
    102D
    9
    A3
    103A
    10
    C3
    103C
    11
    D3
    103D
    12
    A4
    104A
    13
    B4
    104B
    14
    C4
    104C
    15
    D4
    104D

    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    01-22-2016
    Location
    Cambridge, MA
    MS-Off Ver
    2013
    Posts
    3

    Re: Sorting alphanumerical characters sequencially.

    Ron,

    That was very helpful and I will sure give it a try. However, I was looking for a more simple approach to this. I have attached an image of my current column and as you can see I have all the values but I now need to sort them in an ABCDEFGH format but also a 1 to 12 sequence so instead of A1,A2,A3,A4...I would need A1,B1,C1,D1 within the same column. I guess its not much of a formula but a type of sorting out. If I were to make my custom sorting, what would you think would be a way to best accomplish this? I feel like this is so easy yet i cant do it.

  4. #4
    Registered User
    Join Date
    01-22-2016
    Location
    Cambridge, MA
    MS-Off Ver
    2013
    Posts
    3

    Re: Sorting alphanumerical characters sequencially.

    forgot to post the image . here it goesa.JPG

  5. #5
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Sorting alphanumerical characters sequencially.

    I understand....that's a different issue.
    Because the intention was to sort the ID's that way, the numbering should have accounted for the largest expected values. If you could have less then 1000 wells, then the numbering should begin with something like A001 and end with A999.

    Since that didn't happen, try this formula, copied down (assuming the original values begin in E6)
    Please Login or Register  to view this content.
    Does that help?

  6. #6
    Registered User
    Join Date
    01-15-2016
    Location
    Dallas, TX
    MS-Off Ver
    2007
    Posts
    65

    Re: Sorting alphanumerical characters sequencially.

    Hi there!

    You can accomplish your task with a little VBA Sub.

    Open your workbook and hit alt. F11. This will open the VBA editor. Goto the Insert tab and select Module. A window will open. Paste the code below into the window and only two small tasks remain. 1. identifying the column number that contains the data you want to sort, and 2. assigning the macro to a shortcut key, like ctrl+S or something.

    I assume you have headings on your columns. If not we will have to adjust the code for that as well. This code as is, will sort all data from the 2nd row down and I have the sort data column as 3. There is a note around this row explaining which number to change.

    Please Login or Register  to view this content.
    To assign the Macro to a shortcut key, go to the view tab in the ribbon at the top of the spreadsheet. On the right, you will see Macros. Click and select View Macros. If you have multiple macros, find the one called Sort, and highlight it. Click the Options Button. Where it says Shortcut Key, pick the letter you want to use and click OK. Close the Macro window and now, when you hit ctrl+(your letter), the Macro will run, sorting your entire sheet based on the column containing the sort data.

  7. #7
    Registered User
    Join Date
    01-15-2016
    Location
    Dallas, TX
    MS-Off Ver
    2007
    Posts
    65

    Re: Sorting alphanumerical characters sequencially.

    And I just looked at your image above, so here is code corrected for your spreadsheet.

    Please Note... Anything to the right of Column F will move up or down with the stuff inside the border. You can add NOTHING to column A or it will throw the Macro off to the right. You can add NOTHING to rows 1-4 or it will throw the Macro off to the south. It's best if this page stays exactly as is and data only is added to the columns within the borders. In order to make the Macro more stable in that regard, you need to use named ranges... and that - that is a-whole-nother tutorial

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Sorting Alphanumerical values
    By Kreppie in forum Excel General
    Replies: 3
    Last Post: 09-03-2014, 07:49 AM
  2. Sorting out variable length alphanumerical data
    By axtryo in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-21-2013, 01:10 AM
  3. [SOLVED] Sorting by first 2 characters, then by last 4 characters
    By weeble33 in forum Excel General
    Replies: 8
    Last Post: 06-28-2012, 02:09 PM
  4. Excel 2007 : Customer Alphanumerical Format
    By kwengerd in forum Excel General
    Replies: 0
    Last Post: 12-07-2011, 11:46 AM
  5. Summing alphanumerical valves.
    By SloopJohnB in forum Excel General
    Replies: 2
    Last Post: 08-10-2011, 06:07 AM
  6. Words into alphanumerical a key code
    By UbH in forum Excel General
    Replies: 6
    Last Post: 04-16-2009, 05:30 PM
  7. Button to copy sheet, rename sheet sequencially.
    By foxgguy2005 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-17-2005, 09:05 AM

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