+ Reply to Thread
Results 1 to 3 of 3

Keeping blank date cells separate without sorting by the existing dates

  1. #1
    Registered User
    Join Date
    03-08-2023
    Location
    Frankfurt, Germany
    MS-Off Ver
    Office 2010 Home and Business
    Posts
    1

    Keeping blank date cells separate without sorting by the existing dates

    Hi,

    I have a list of members and a column of dates when they paid their membership fee. Some have not paid yet, so the cells are empty. Now I want to sort the list so that the entries with a blank date are kept separate but the whole list can be sorted by the names. This makes it possible to see who has paid, keeping the names in alphabetical order in both blocks.

    I'm attaching several versions of a small sample file.
    Sorting blank dates_0.xlsx shows the initial, unsorted state.
    In blank_dates_1.xlsx the rows are sorted first by date, then by name. This keeps the blanks as a block at the bottom, but the sorting by date takes priority, and only the blank cells are sorted by name.
    In blank_dates_2.xlsx I have applied a "dirty trick" to achieve the desired result: All but the filled cells have a very dark grey as their text color, the filled ones have "Automatic". Sorting that column not by values, but by text color does the trick: The rows with filled as well as with blank dates are sorted by name, while keeping the blocks separate.
    However, this means that whenever someone pays and I fill a cell, I need to change the text color afterwards.

    Does anyone know a more elegant way how to achieve this result?

    Thanks,
    Tohm59
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    1,987

    Re: Keeping blank date cells separate without sorting by the existing dates

    You could perhaps add a helper column with a formula to return 0 if the date is blank and 1 if it's not.
    Then, when you sort, first sort by the helper column and then by the name.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,477

    Re: Keeping blank date cells separate without sorting by the existing dates

    If sorting by colour works for you, why not use Conditional Formatting to set (or clear) the colour? Pretty sure sorting by colour doesn't care how the colour came to be there.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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: 3
    Last Post: 07-24-2017, 01:41 PM
  2. [SOLVED] Adding new row keeping existing format all the wile keeping worksheet protected.
    By nsmjc in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-13-2017, 02:53 PM
  3. Replies: 1
    Last Post: 10-12-2016, 09:20 PM
  4. [SOLVED] If dates are blank then in that date row all rightside cells should be blank.
    By Sekars in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 04-04-2016, 03:19 PM
  5. Keeping blank rows when sorting
    By duffer_devon in forum Excel General
    Replies: 12
    Last Post: 07-23-2014, 04:03 AM
  6. [SOLVED] Keeping blank rows at the bottom while sorting a 300 row spreadsheet
    By badiller in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-26-2013, 02:13 PM
  7. Replies: 5
    Last Post: 04-02-2012, 11:51 AM

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