+ Reply to Thread
Results 1 to 7 of 7

Sorting "" properly for date formatted column

Hybrid View

  1. #1
    Registered User
    Join Date
    10-31-2013
    Location
    Your, Basement
    MS-Off Ver
    Excel 2013
    Posts
    6

    Sorting "" properly for date formatted column

    Having an issue with sorting dates properly.

    Formula in each cell of column P is:
    =IF(O6="","",INT(O6)+120)

    *have also tried
    =IF(ISBLANK(O6),"",INT(O6)+120)

    The issue is when filtering column P I can only sort a-z as opposed to oldest to newest

    Ran test on it [ =ISTEXT(P6) ] and find that if there is a date in it result is false and if not, "" returns as True.

    So the issue is that Excel sees the blank "" as text and tries to filter accordingly. Is there a solution to this or am I stuck with 1/1/1900 instead of blanks if I want to be able to filter properly?
    Last edited by TheGunslinger; 05-06-2015 at 04:32 PM. Reason: edited for clarity

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

    Re: Sorting "" properly for date formatted column

    Your problem is not at all clear as to what you are dealing with. It could be as simple as =IF(O6="","",O6+120) for column P if the data in column O are real dates.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Last edited by newdoverman; 05-06-2015 at 04:56 PM.
    <---------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

  3. #3
    Registered User
    Join Date
    10-31-2013
    Location
    Your, Basement
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: Sorting "" properly for date formatted column

    Edited sheet to remove sensitive data so what I referred to as column O is now J and P is now K

    The issue is I want to be able to sort the sheet by the dates in column k oldest to newest and I only have the option of A -> Z

    I have copied the formula quite a ways down in the spreadsheet as this is intended to be a shared sheet and other users will not have the know how to copy that information down into each new row.
    Attached Files Attached Files
    Last edited by TheGunslinger; 05-06-2015 at 05:10 PM.

  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 "" properly for date formatted column

    There is something strange with column K. Insert a new column and format as Date and enter =IF(J2="","",J2+120) in row 2 and fill down. Delete the old column K and title the new column.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-31-2013
    Location
    Your, Basement
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: Sorting "" properly for date formatted column

    It seems to revert back to a-z as soon as i fill more than 3 cells that return blank with the formula. In the file you created the formula only exists in the cells that already have data, try putting that formula into more than 3 cells that will generate a "" result, it may just be an issue with my version of excel?

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Sorting "" properly for date formatted column

    Change "" to 0 and hide the 0 using formatting or set the workbook to not show 0 values in File>Options.

    Or you could sort by DATE OF HIRE and you would get the same results as you would if you sorted chronologically on PAYMENT DATE
    If posting code please use code tags, see here.

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

    Re: Sorting "" properly for date formatted column

    I see what is happening. I left a few blank rows and filled the formula down....the result was that the filter reverted to A-Z type sorting. If I entered a date after the blank area, the filter again reverted back to Oldest to Newest again. It is an oddity that the blank cells if not "bracketed by dates" (date entered after the blanks) will be treated as text.

    I would convert all the data to a table and not fill any more rows than you have data for. All formulae will fill as you add more rows.
    Last edited by newdoverman; 05-06-2015 at 06:09 PM.

+ 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] Date Format "d-mmm-yy" as Worksheet Name does not sort properly
    By tv69 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-13-2013, 03:35 PM
  2. [SOLVED] If there is any text in column "A$" on "sheet1" then move cell to column "A$" on "sheet2"
    By ckgeary in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-27-2013, 08:28 PM
  3. Format(date,"mm/dd") returns date formatted as "mm-dd"
    By MenacingBanjo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-16-2013, 09:15 AM
  4. In Excel a cell formatted "currency" shows "######" help!
    By llveda in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-07-2006, 04:40 PM
  5. [SOLVED] Excel shouldn't ***** about a "date format" when formatted as txt
    By Ibbits in forum Excel General
    Replies: 5
    Last Post: 07-18-2005, 01:05 PM

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