+ Reply to Thread
Results 1 to 6 of 6

Format Cell by Date

  1. #1
    Registered User
    Join Date
    09-16-2009
    Location
    usa,florida
    MS-Off Ver
    Microsoft 365
    Posts
    30

    Format Cell by Date

    Hi,

    I am trying to sort my excel sheet by dates.
    The problem is that some cells have different format of dates (some include the year and some are not)

    13/09/2017
    14/09

    Using Format cell function they are now look the same.
    13/09
    14/09

    A few are not converting nicely

    so 12/9/2017 becomes 09/12 instead of 12/09

    However when trying to sort them by year it's messes up because the real value of the cell still has the 2017 in it.

    After sorting:

    Date
    09/04
    09/05
    09/07
    09/12
    09/12
    13/09
    28/08
    29/08
    31/08

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Format Cell by Date

    Please upload a sample workbook of your data.

  3. #3
    Registered User
    Join Date
    09-16-2009
    Location
    usa,florida
    MS-Off Ver
    Microsoft 365
    Posts
    30

    Re: Format Cell by Date

    https://ufile.io/9kzvp
    Attached Files Attached Files

  4. #4
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Format Cell by Date

    The problem here is that we have no way of knowing if 09/12 is supposed to be September 12th or December 9th. Can we assume that these are all in 2017?

    Are the dates that you shared in post #3 supposed to be dates in August and September only? If so, try this:

    B2 =IF(ISNUMBER(A2),DATE(YEAR(A2),DAY(A2),MONTH(A2)),DATE(2017,RIGHT(A2,2),LEFT(A2,2)))

  5. #5
    Forum Contributor
    Join Date
    08-16-2012
    Location
    Pendleton, OR
    MS-Off Ver
    Excel 2013
    Posts
    129

    Re: Format Cell by Date

    It seems that some of your dates are not being stored and read as dates by Excel. In other words, they are not seen as a number of days past Jan. 1, 1900 - Windows date format. And the ones it does read as dates are formatted in the European fashion (i.e. 09/12 = December 9th). Check your original source for these values.

  6. #6
    Registered User
    Join Date
    09-16-2009
    Location
    usa,florida
    MS-Off Ver
    Microsoft 365
    Posts
    30

    Re: Format Cell by Date

    Quote Originally Posted by 63falcondude View Post
    The problem here is that we have no way of knowing if 09/12 is supposed to be September 12th or December 9th. Can we assume that these are all in 2017?

    Are the dates that you shared in post #3 supposed to be dates in August and September only? If so, try this:

    B2 =IF(ISNUMBER(A2),DATE(YEAR(A2),DAY(A2),MONTH(A2)),DATE(2017,RIGHT(A2,2),LEFT(A2,2)))
    Thank you! works like a charm.

    Best way to automate it to apply for A Columns for future addition of dates?

    Some sort of a Macro?

    Right now I just copy paste values back to Column A.

+ 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 in cell differs from date format in formula bar
    By aziliza in forum Excel General
    Replies: 8
    Last Post: 08-23-2016, 01:12 AM
  2. Replies: 2
    Last Post: 10-11-2015, 06:06 AM
  3. Replies: 2
    Last Post: 06-02-2015, 08:42 AM
  4. Show Error when a cell with number format change to date format
    By delroba in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-08-2015, 02:57 AM
  5. Replies: 1
    Last Post: 12-09-2014, 05:06 AM
  6. Replies: 1
    Last Post: 11-01-2012, 10:37 AM
  7. Replies: 2
    Last Post: 10-02-2010, 04:41 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