+ Reply to Thread
Results 1 to 4 of 4

Sorting - Interlacing

  1. #1
    Registered User
    Join Date
    07-03-2014
    Location
    Antwerp, Belgium
    MS-Off Ver
    MS Office 2010
    Posts
    10

    Sorting - Interlacing

    Hi,

    Does excel have a possibility to interlace data in stead of sorting them the conventional way?

    I mean like this;
    Suppose you have data

    A
    B
    B
    A

    If you sort them, they become:
    A
    A
    B
    B

    but what I want is:

    A
    B
    A
    B

    Any Solutions?

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Sorting - Interlacing

    I am not sure where this is going but, for this particular example try this formula

    in B1 and copy it down

    =INDEX($G$1:$G$6,MOD(ROWS($A$1:A1)-1,2)+1)

    A
    B
    1
    A A
    2
    B B
    3
    B A
    4
    A B
    Last edited by AlKey; 09-04-2014 at 09:42 AM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Sorting - Interlacing

    I would be tempted to add a helper column that counts the number of A's and B's above that row. Something like =COUNTIF($A$1:A1,A1) [note the mix of relative and absolute referencing to control the input range.] http://office.microsoft.com/en-us/ex...077.aspx?CTT=1

    Then a two key or two level sort where the first key is this helper column (increasing from 1 to whatever) and the 2nd key is column A (the column containing the A's and B's).
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Sorting - Interlacing

    Something like this could work. It is a modification of MrShorty's solution

    In column B enter this formula and copy down then select all the data and do 1 sort on column B:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Result:
    A
    B
    C
    1
    a 1a =COUNTIF($A$1:A1,A1)&A1
    2
    b 1b
    3
    a 2a
    4
    b 2b
    5
    a 3a
    6
    b 3b
    7
    a 4a
    8
    b 4b
    9
    a 5a
    10
    b 5b
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

+ 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: 0
    Last Post: 02-24-2014, 11:27 AM
  2. Sorting 2 data ranges by comparing one column in each and sorting to match
    By MDKsmiffy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-17-2013, 03:30 PM
  3. Sorting a range to invert it upside down without sorting by any specific column
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-29-2013, 12:53 PM
  4. [SOLVED] Sorting a range to invert it upside down without sorting by any specific column
    By luv2glyd in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-28-2013, 12:43 PM
  5. function interlacing
    By AV1406 in forum Excel General
    Replies: 4
    Last Post: 05-14-2009, 06:39 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