+ Reply to Thread
Results 1 to 4 of 4

Natural Sort cell contents

  1. #1
    Registered User
    Join Date
    09-04-2013
    Location
    richardson, tx
    MS-Off Ver
    Excel 20037
    Posts
    28

    Natural Sort cell contents

    Can anyone suggest a sub-routine or procedure to naturally sort cell contents? For example, if a cell contains "TP15, TP5, TP1, TP10" my current sort routine produces "TP1, TP10, TP15, TP5". I would like the output to show "TP1, TP5, TP10, TP15" Any suggestions?

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Natural Sort cell contents

    Here's a somewhat kludgy way. The function separates the string part from the number part. It will work if the number part is at the end of the string. What you do is get the number part in one cell and remove it from the string part in another then do a multi-level sort.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    09-04-2013
    Location
    richardson, tx
    MS-Off Ver
    Excel 20037
    Posts
    28

    Re: Natural Sort cell contents

    Thanks dflak. I will give it a try.

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

    Re: Natural Sort cell contents

    Quote Originally Posted by Gandalf2524 View Post
    For example, if a cell contains "TP15, TP5, TP1, TP10" my current sort routine produces "TP1, TP10, TP15, TP5". I would like the output to show "TP1, TP5, TP10, TP15" Any suggestions?
    UDF

    Use in cell like
    =SortCell(A1,", ")

    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. [SOLVED] Sort contents within a cell
    By MarkitaVessier in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-04-2015, 06:46 PM
  2. Replies: 3
    Last Post: 06-29-2015, 03:03 PM
  3. Sort by certain column if certain cell contents change
    By Smeghead in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-20-2015, 07:15 AM
  4. [SOLVED] Sort Contents of a Cell
    By Gandalf2524 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-06-2014, 08:38 AM
  5. Sort by the partial contents of a cell
    By WasWodge in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-24-2011, 03:11 PM
  6. natural log problem
    By greenlee22 in forum Excel General
    Replies: 2
    Last Post: 04-07-2011, 08:56 PM
  7. Hide contents of a cell but not remove in a sort
    By rdd2 in forum Excel General
    Replies: 2
    Last Post: 03-13-2009, 09:20 AM

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