+ Reply to Thread
Results 1 to 7 of 7

Sorting by Two Columns: Sort Blanks Last

  1. #1
    Registered User
    Join Date
    05-17-2013
    Location
    St. Petersburg
    MS-Off Ver
    Excel 2010
    Posts
    74

    Sorting by Two Columns: Sort Blanks Last

    Hi,

    Is there a way to force Excel to sort these two columns based on column A but starting with cells where column B is not empty?

    Column A      Column B
    a              9
    b
    c              12
    d
    e              7

    should be sorted like this:

    Column A      Column B
    a              9
    c              12
    e              7
    b
    d

    "Helper" columns aren't an option. The file is large enough already without adding anything else to it...

  2. #2
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Sorting by Two Columns: Sort Blanks Last

    Home - Sort & Filter - Custom Sort - Sort byy column B in first dropdown - Largest to Smallest - Done
    Click the * to say thanks.

  3. #3
    Registered User
    Join Date
    05-17-2013
    Location
    St. Petersburg
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: Sorting by Two Columns: Sort Blanks Last

    Quote Originally Posted by PaulM100 View Post
    Home - Sort & Filter - Custom Sort - Sort byy column B in first dropdown - Largest to Smallest - Done
    No, that will get you this:

    Column A      Column B
    c              12
    a              9
    e              7
    b
    d

    and it should be:

    Column A      Column B
    a              9
    c              12
    e              7
    b
    d

  4. #4
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Sorting by Two Columns: Sort Blanks Last

    Select fisrt 2 columns - Press Ctrl+G - Special - Blanks - Ok. Add a colour or a font colour to them
    Home - Sort & Filter - Custom Sort - Sort by column B in first dropdown - Filter by colour in second dropdown - Select the cell colour or font colour in 3rd dropdown - Finally select bottom

  5. #5
    Registered User
    Join Date
    05-17-2013
    Location
    St. Petersburg
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: Sorting by Two Columns: Sort Blanks Last

    Quote Originally Posted by PaulM100 View Post
    Select fisrt 2 columns - Press Ctrl+G - Special - Blanks - Ok. Add a colour or a font colour to them
    Home - Sort & Filter - Custom Sort - Sort by column B in first dropdown - Filter by colour in second dropdown - Select the cell colour or font colour in 3rd dropdown - Finally select bottom
    Thanks, I've thought of that, too. But the thing is: I cannot modify the cells in ANY way. I was hoping for some trick with sorting that I somehow overlooked or - as a last resort - a VBA script...

  6. #6
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Sorting by Two Columns: Sort Blanks Last

    Ok, here is a VBA solution:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    05-17-2013
    Location
    St. Petersburg
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: Sorting by Two Columns: Sort Blanks Last

    Quote Originally Posted by PaulM100 View Post
    Ok, here is a VBA solution
    Sorry, no again.
    Your script does not sort entries in column A alphabetically for each case (first, where column B isn't empty, and then where it is...)

+ 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] When sorting other columns don't sort- how to fix?
    By kevwilsondj in forum Excel General
    Replies: 3
    Last Post: 10-27-2015, 04:09 PM
  2. Sort multiple columns to one column, skip blanks
    By AlexCoyne in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-20-2013, 03:13 PM
  3. Sorting at two columns (Advanced Sort doesn't help)
    By shashjindal in forum Excel General
    Replies: 3
    Last Post: 12-16-2011, 02:18 AM
  4. Line-up Columns by Sort and Leaving Blanks for no data.
    By peaceeasy in forum Excel General
    Replies: 1
    Last Post: 07-11-2011, 07:35 PM
  5. Replies: 3
    Last Post: 06-09-2011, 05:58 AM
  6. Sorting by columns with blanks
    By khaos in forum Excel General
    Replies: 1
    Last Post: 05-01-2009, 06:04 PM
  7. Sorting Columns (blanks)
    By rushdenx1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-28-2007, 03:33 PM

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