+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    12-02-2009
    Location
    New York State
    MS-Off Ver
    Excel 2003
    Posts
    48

    Sorting column by contents of every 7th row

    I have inherited a list of contacts which is very messy.

    It looks about like the attached sample except it is very long.

    I would like to sort the list so that it is aphabetical according to the contents of the cells immediately under each tan-colored cell, which I will refer to here as the "Business Name" cells.

    I would like to bring along in the sort the contents of the five cells under each "Business Name" cell. That is to say that the unsystematic address, phone, etc. information which appears under each business name should still appear under the same business name after the sorting process.

    Thank you for considering my problem.
    Attached Files Attached Files
    Last edited by excelname; 12-18-2009 at 11:26 AM.

  2. #2
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    10,478

    Re: Sorting column by contents of every 7th row

    one way put this in b2 and drag down
    =INDIRECT("A"&ROWS($A$1:A1)-MOD(ROWS($A$1:A1),7)+2)
    then sort by column b
    Mojito connoisseur and a dabbler in Cisco
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    12-02-2009
    Location
    New York State
    MS-Off Ver
    Excel 2003
    Posts
    48

    Re: Sorting column by contents of every 7th row

    OK I solved my own problem but I suspect there was an easier way.

    What I did:

    1. Recorded a (relative) macro which took the 5 fields under each Business Name and arrayed them in the cells to the right of the Business name (and ran the macro over and over; gotta look up how to loop macros!).

    2. Sorted the entire array by the Business Name column to get the order I wanted.

    3. Recorded a (relative) macro which inserted 5 enpty rows beneath the first Business Name and then brought the data, now arrayed off to the left, back under the Business Name as it had originally been, then moved to the next Business Name down the list (and ran the macro over and over.)

    If anyone knows a more elegant way to do this I'd be interested to hear it.

    Thanks.

  4. #4
    Registered User
    Join Date
    12-02-2009
    Location
    New York State
    MS-Off Ver
    Excel 2003
    Posts
    48

    Re: Sorting column by contents of every 7th row

    Quote Originally Posted by martindwilson View Post
    one way put this in b2 and drag down
    =INDIRECT("A"&ROWS($A$1:A1)-MOD(ROWS($A$1:A1),7)+2)
    then sort by column b
    Thanks martinwilson.

    That is about a million times easier.

    Using that technique will ease list maintenance a great deal.
    Last edited by excelname; 12-17-2009 at 02:22 PM. Reason: tried it and it worked

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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.2.0