+ Reply to Thread
Results 1 to 2 of 2

Sort column, new sort after each blank cell

  1. #1
    Registered User
    Join Date
    01-28-2010
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    40

    Sort column, new sort after each blank cell

    I have a column of numbers which has blank cells throughout. How might I sort the column and after each blank cell sort the next range of cells again in order, keeping the blank cells in place. Example below
    Old New
    1 1
    6 2
    3 3
    2 6

    2 1
    5 1
    1 2
    1 4
    4 5

    9 1
    3 2
    8 3
    1 7
    7 8
    2 9

    Many thanks

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,417

    Re: Sort column, new sort after each blank cell

    Introduce a helper column (column B) and insert a blank row 1 above your data. Put zero in cell B1 and this formula in B2:

    =IF(A2="",MAX(B$1:B1)+1,B1)

    Copy this down to the bottom of your data. Then select the data in columns A and B, from row 2 onwards, and apply your sort, choosing column B as the first sort key, then column A.

    You can remove column B afterwards if you don't need it.

    Hope this helps.

    Pete

+ 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: 2
    Last Post: 01-15-2014, 09:31 AM
  2. Sort spreadsheet column but exclude blank cells
    By Lynton in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-21-2013, 03:13 AM
  3. Replies: 5
    Last Post: 04-25-2013, 11:50 PM
  4. Excel sort help, three column conditional sort
    By moneill99 in forum Excel General
    Replies: 1
    Last Post: 03-24-2012, 04:05 PM
  5. Replies: 3
    Last Post: 05-17-2009, 04:31 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