+ Reply to Thread
Results 1 to 3 of 3

Sort by text in the middle of a string

  1. #1
    Registered User
    Join Date
    01-07-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    24

    Sort by text in the middle of a string

    I have a data-set 64 column wide and 121 rows deep. The headers are made from a combination of 4-R’s (R0, R15, R30 and R45), 4-H’s (H6, H7, H8 and H9) and 4-D’s (D2, D4, D6 and D8), resulting in text strings such as: R0-H6-D2, R15-H6-D2...etc. (see picture attached). : I want to sort my 64-columns by ‘H’ such that:
    -1st 16 columns will have H6 as the middle value
    -2nd 16 columns will have H7 as the middle value
    -3rd 16 columns will have H8 as the middle value
    -And the last 16 will have H9 as the middle value

    Any help is much appreciated!
    Attached Images Attached Images

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Sort by text in the middle of a string

    I would suggest making a helper row to extract the H6/H7/H8/H9 and then sort by the helper row.

    =mid(A1,find("H",A1,1),2)

    should do it.

  3. #3
    Registered User
    Join Date
    01-07-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Sort by text in the middle of a string

    Quote Originally Posted by yudlugar View Post
    I would suggest making a helper row to extract the H6/H7/H8/H9 and then sort by the helper row.

    =mid(A1,find("H",A1,1),2)

    should do it.
    yudluga,
    That did it beautifully. Thanks a lot!

+ 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] How to remove dot(s) .. or ... in front of text string, not in a middle
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-23-2013, 05:45 PM
  2. [SOLVED] if formula looking at value in middle of text string
    By SAsplin in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 04-25-2013, 06:57 AM
  3. [SOLVED] pulling text from the middle of a string
    By DRFILL in forum Excel General
    Replies: 3
    Last Post: 09-21-2012, 11:35 AM
  4. Extract text from the middle of a string for concatenation
    By christopherp in forum Excel General
    Replies: 1
    Last Post: 05-16-2011, 08:55 AM
  5. delete middle part of text string
    By maacmaac in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-30-2009, 03:59 PM

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