+ Reply to Thread
Results 1 to 6 of 6

Sorting mixed letters/numbers from low to high numerically

  1. #1
    Registered User
    Join Date
    06-27-2020
    Location
    Florida
    MS-Off Ver
    2016
    Posts
    19

    Sorting mixed letters/numbers from low to high numerically

    Hello, I'm trying to sort a list of combined letters and numbers so that they appear numerically in ascending order. Here's how the regular sort option sorts it now:

    STG.L1
    STG.L11
    STG.L15
    STG.L3
    STG.L7

    But I need it sorted like this:

    STG.L1
    STG.L3
    STG.L7
    STG.L11
    STG.L15

    Is there some code that can allow this to happen? Thanks!

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    23,966

    Re: Sorting mixed letters/numbers from low to high numerically

    For your example, with Power Query, here is the Mcode

    Please Login or Register  to view this content.
    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,597

    Re: Sorting mixed letters/numbers from low to high numerically

    Select the range and run the code.
    Please Login or Register  to view this content.
    Last edited by jindon; 11-14-2020 at 07:40 AM.

  4. #4
    Valued Forum Contributor
    Join Date
    06-27-2010
    Location
    sYRIA
    MS-Off Ver
    Excel 2013
    Posts
    669

    Re: Sorting mixed letters/numbers from low to high numerically

    Hi
    your data starts from A1 down
    Try
    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,628

    Re: Sorting mixed letters/numbers from low to high numerically

    Here is the code with example.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,628

    Re: Sorting mixed letters/numbers from low to high numerically

    One more approach.
    DATA in A2:A6

    formula in B2 then copied down
    =0+SUBSTITUTE(A2,"STG.L","")

    Select A2:B6

    Sort on the column B

    Delete Data in column B
    Last edited by kvsrinivasamurthy; 11-14-2020 at 07:52 AM.

+ 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. Help with summing up a column of mixed numbers and letters
    By oputa ossai in forum Excel General
    Replies: 14
    Last Post: 05-24-2019, 04:17 PM
  2. Sort Mixed Data With Periods, Letters, Numbers, Backslashes and Hyphens
    By officemate in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-16-2015, 01:59 PM
  3. vlookup with mixed numbers and letters
    By rolex in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-16-2015, 08:28 AM
  4. Replies: 3
    Last Post: 11-26-2014, 02:44 PM
  5. Replies: 4
    Last Post: 03-20-2014, 01:39 PM
  6. Extracting Numbers From Text Range And Sorting Numerically
    By jon87 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-29-2012, 10:15 AM
  7. 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