+ Reply to Thread
Results 1 to 7 of 7

Date order

  1. #1
    Registered User
    Join Date
    10-10-2014
    Location
    Dublin Ireland
    MS-Off Ver
    Microsoft 365 MSO (Version 2309 Build 16.0.16827.20130)
    Posts
    36

    Date order

    I have the string =SUBSTITUTE((LEFT(RIGHT(B1,11),10)),".","/") which sorts the entries in date order.
    Except for the entries that have x for a value ie (xx.12.1994)
    These it bunches up down the bottom of the list.

    I was given another string =IFERROR(DATE(YEAR(C1),MONTH(C1),DAY(C1)),SUBSTITUTE(SUBSTITUTE(C1,"xx","01"),"x",1))*1
    but this puts the xx entries at the beining of the month or the year where i want them to be at the end of the month or year.

    I need a string that would give me the following
    For example (xx.12.1994) would go after (31.12.1994)
    and (xx.xx.199x) would go just before (01.01.2000)

    Any help appreciated
    Last edited by antoinb; 12-31-2014 at 12:28 PM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,412

    Re: Date order

    The problem is if you use x then the "date" will actually be a text value, whereas the proper dates will be numbers. If you want to sort them in the order you indicate, then you should use a format which puts the year first, followed by the month and finishing with the day, and each of these should be the same length - you can keep the full-stop as the delimiter, or use some other character not associated with dates, so that Excel will not try to convert proper dates into numbers.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    10-10-2014
    Location
    Dublin Ireland
    MS-Off Ver
    Microsoft 365 MSO (Version 2309 Build 16.0.16827.20130)
    Posts
    36

    Re: Date order

    Thanks for the response Pete,
    sadly i already have 28000 plus entries with as you can imagine quite a few already in the xx format.
    I am however lifting entries out of the main sheet on to a new workbook to apply the strings i mentioned above.
    Is there anything i could change the xx to , you mentioned "or use some other character not associated with dates"
    Regards
    Ant

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,412

    Re: Date order

    Post a small sample file, showing a range of date types that you have - it should be possible to come up with a formula that you can copy down your 28000 entries, so keep the sample in the same layout.

    Pete

  5. #5
    Registered User
    Join Date
    10-10-2014
    Location
    Dublin Ireland
    MS-Off Ver
    Microsoft 365 MSO (Version 2309 Build 16.0.16827.20130)
    Posts
    36

    Re: Date order

    Here is a typical worksheet, i would pick this artist specific info from the main sheet, place it in a new workbook and then date order it by putting the first string i mentioned in C
    Regards
    Ant
    Attached Files Attached Files

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,412

    Re: Date order

    You could put this formula in C1:

    =MID(B1,LEN(B1)-4,4)&"."&MID(B1,LEN(B1)-7,2)&"."&MID(B1,LEN(B1)-10,2)

    then copy down to the bottom of your data. Then select all your data in columns A to D, click sort and sort on column C - it should give you the order you require, and you can delete column C if you no longer require it.

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    10-10-2014
    Location
    Dublin Ireland
    MS-Off Ver
    Microsoft 365 MSO (Version 2309 Build 16.0.16827.20130)
    Posts
    36

    Re: Date order

    Pete You are an absolute superstar, thank you so much, that works perfectly

+ 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: 4
    Last Post: 12-02-2014, 03:46 AM
  2. Replies: 1
    Last Post: 12-01-2014, 03:01 PM
  3. Add date criteria matching order date and sales date
    By Luther.King in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-25-2014, 10:09 AM
  4. Calculate ship date based on date and time order is received
    By joekomar in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-23-2013, 10:57 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