+ Reply to Thread
Results 1 to 9 of 9

How do I sort column with mixed letters and digits?

  1. #1
    Registered User
    Join Date
    01-15-2015
    Location
    Sweden
    MS-Off Ver
    2007
    Posts
    5

    How do I sort column with mixed letters and digits?

    Hi guys! I have a datasheet and there is a row with mixed digits and letters.. It looks like this:
    55J 85 BU5990
    55K 23 BU5999
    30K 99 BU7909
    908 8 JO6540
    2387 LOOI BU2345
    981J 09I JO764
    and so on...

    How can I get Excel to sort only the BU and JO? I mean, I want Excel to ignore whatever is infront of BU and JO because that is not important.
    And the BU and JO can vary between 3 digits to 9 digits. I want to sort this so it starts with the loest digits after BU and JO..

    How do I do this? I am a beginner to Excel. So please help me out here. Is this even possible? So whatever is infront of BU and JO should be ignored, and only sort after what is after BU and JO...

    Does this make any sense for you?

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How do I sort column with mixed letters and digits?

    Hi,

    Do you want to sort with the numeric as the primary key, (meaning the BUs and JOs may be mixed up) or do you want to sort all the BUs & JOs together and then within each of BU & JO sort the numerics?

    Incidentally would you add your location to your profile. It often helps when others are making suggestions.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    01-15-2015
    Location
    Sweden
    MS-Off Ver
    2007
    Posts
    5

    Re: How do I sort column with mixed letters and digits?

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    Do you want to sort with the numeric as the primary key, (meaning the BUs and JOs may be mixed up) or do you want to sort all the BUs & JOs together and then within each of BU & JO sort the numerics?

    Incidentally would you add your location to your profile. It often helps when others are making suggestions.
    I want the result so be as follow:
    all BUs first and the all the JOs

    Like this:
    2387 LOOI BU2345
    55J 85 BU5990
    55K 23 BU5999
    30K 99 BU7909
    981J 09I JO764
    908 8 JO6540
    12J 2 JO9897


    And so on. I am at a Swedish location.
    Last edited by harproblem; 01-15-2015 at 06:50 AM.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How do I sort column with mixed letters and digits?

    Hoi,

    Would you upload the actual workbook. The text you've posted contains what appear as space characters but some of which are non breaking space characters. Unless we're sure what is there in the production workbook it's somewhat difficult to formulate an answer.

  5. #5
    Registered User
    Join Date
    01-15-2015
    Location
    Sweden
    MS-Off Ver
    2007
    Posts
    5

    Re: How do I sort column with mixed letters and digits?

    I cut out a small part of the workbook, since it all the same.Sheet.xlsx

  6. #6
    Registered User
    Join Date
    01-15-2015
    Location
    Sweden
    MS-Off Ver
    2007
    Posts
    5

    Re: How do I sort column with mixed letters and digits?

    Can anyone help me out here?

  7. #7
    Registered User
    Join Date
    11-05-2014
    Location
    Lafayette California
    MS-Off Ver
    2013
    Posts
    24

    Re: How do I sort column with mixed letters and digits?

    Hi,

    Im pretty sure I have done what you are asking for. I havent gone through to make sure the items were sorted properly, but i will trust excels sorting capabilities. So first what i did was highlight the data you provided then went up to the data tab and clicked on "Text to Columns". After doing this you select what criteria you would like to separate your data by. In this case i separated by spaces. This gave me 3 columns, one of which has the BUs and the JOs. Next i highlighted all 3 columns of data and i went to the custom sort option under sort & filter in the home tab. Then you choose what column to sort by and by what criteria. I sorted on column L and by values. it also has a box to choose what order to sort in. Choose custom list and add BU and JO. this will sort the numbers behind BU then JO. To finish i used the concatenate function entered as follows =concatenate(J1," ",K1," ",L1) then copy down. I put two spaces between the quotes to keep about the same amount of space between numbers as the original. One thing i did notice is that the numbers following BU and JO are sorted in ascending order by individual place rather than as a whole.

    It comes out something like this
    BU2114
    BU231
    BU2331

    What I think youre looking for
    BU231
    BU2114
    BU2331

    However I am not sure how to work around that part. Heres the file i worked on.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    01-15-2015
    Location
    Sweden
    MS-Off Ver
    2007
    Posts
    5

    Re: How do I sort column with mixed letters and digits?

    Awesome, this is exactly what I want.Thanks alot, this makes it alot easier for me. Thanks!

  9. #9
    Registered User
    Join Date
    05-10-2013
    Location
    Pomáz, Hungary
    MS-Off Ver
    Excel 2007
    Posts
    78

    Re: How do I sort column with mixed letters and digits?

    Enter into I1 with Ctrl+Shift+Enter and copy down:

    =-LOOKUP(0,-MID(REPLACE(H1,1,MIN(FIND({" BU"," JO"},H1&" BU JO")),""),3,{1,2,3,4,5,6,7,8,9}))-IF(LEFT(REPLACE(H1,1,MIN(FIND({" BU"," JO"},H1&" BU JO")),""),2)="BU",10^10,0)

    Then select columns I and J and sort them according to column J from Smallest to Largest.

    If you do not need what is in front of BU or JO, enter into K1 and copy down:

    =REPLACE(H1,1,MIN(FIND({" BU"," JO"},H1&" BU JO")),"")

    If your Excel version works with „;” as an argument separator, substitute each comma in the formulas with „;”.

+ 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. Replies: 1
    Last Post: 08-27-2014, 11:05 AM
  2. Replies: 4
    Last Post: 03-20-2014, 01:39 PM
  3. [SOLVED] extracting digits only from column with letters and digits
    By Jayne in forum Excel General
    Replies: 11
    Last Post: 08-20-2012, 10:38 PM
  4. Counting numberical values mixed with letters: Yes, Yes+1, Yes+2, etc.
    By KatherineMolina in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-16-2008, 02:49 PM
  5. Sort mixed numbers/letters
    By V-ger in forum Excel General
    Replies: 1
    Last Post: 11-14-2005, 06:55 PM

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