1. Welcome to Chandoo.org Forums. Short message for you

    Hi Guest,

    Thanks for joining Chandoo.org forums. We are here to make you awesome in Excel. Before you post your first question, please read this short introduction guide. When posting or responding to questions please remember our values at Chandoo.org are: Humility, Passion, Fun, Awesomeness, Simplicity, Sharing Remember that we have people here for whom English is not there first language and we need to allow for this in our dealings.

    Yours,
    Chandoo
  2. Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  3. When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Dates (not really dates) not sorting properly

Discussion in 'Ask an Excel Question' started by Carlos Ruano, Jan 11, 2018.

  1. Carlos Ruano

    Carlos Ruano Member

    Messages:
    45
    Hi,

    I have a sheet with a column of "dates". I need to be able to sort the dates, but cannot do it since the dates aren't really dates. The problem is that I do not know how to make them dates. I have tried several things including Text to Columns, but nothing has worked so far.

    I have attached a sample portion of the file (dates in column G). Any help would be greatly appreciated.

    Thank you!
    Carlos

    Attached Files:

  2. Chihiro

    Chihiro Excel Ninja

    Messages:
    4,062
    How is the data brought into Excel?

    Following formula will fix most of them.
    =IF(ISNUMBER(G2),G2,DATE(20&RIGHT(G2,2),MONTH((MID(G2,4,3)&"/1")*1),LEFT(G2,2)))

    But there's few that lack "-" or "/" between date and month part, and will not resolve with above.

    You can add additional operation to above formula (or have month short name list and perform lookup using it). But I'd recommend enforcing appropriate data entry process rather than trying to fix the data format after the fact.
  3. Carlos Ruano

    Carlos Ruano Member

    Messages:
    45
    This is awesome! Thank you so much.

    If you have the time, I would really appreciate it if you could explain how your formula works. I am particularly interested in the DATE and MONTH functions.

    Thanks again!
  4. Khalid NGO

    Khalid NGO Excel Ninja

    Messages:
    1,867
    Hi to all,

    DateValue function is very useful in this case, for example this can be used:

    =IF(ISNUMBER(G2),G2,DATEVALUE(G2))

    Regards,
  5. John Jairo V

    John Jairo V Well-Known Member

    Messages:
    410
    Hi, to all!

    Try this too:
    =IFERROR(--G2,DATEVALUE(G2))

    Blessings!
    Thomas Kuriakose likes this.

Share This Page