+ Reply to Thread
Results 1 to 14 of 14

I need to extract dates from a column that contains other information. Format varies.

  1. #1
    Registered User
    Join Date
    11-30-2021
    Location
    UK
    MS-Off Ver
    Office 365 for Enterprise
    Posts
    5

    I need to extract dates from a column that contains other information. Format varies.

    I have attached an image. As you can see, I am calling for the dates from the original data on the far right. Most of them are in the format DD-M/MM-YY, but some are D-M/MM-YY. When they are D-M-YY, they print as "- D-M-YY" as I am calling a fixed value (=RIGHT(CELL,8)) and when the date is D-MM-YY, they print as " D-MM-YY".

    Ideally I would like to be able to call just the date, if possible have the data called formated so that it is consistent. So I need a formula that is a bit more flexible and can call from the cell containing "LOCATION - DATE" and print it in column B as "DD-MM-YY". I'd use the if isnumber search formula, but seeing as there are four variations I can't (DD-MM-YY, D-MM-YY, D-M-YY, DD-M-YY)

    I need the dates consistent as, once complete I want to dock the headers and sort the rows by date.

    Any constructive input would be appreciated. I've uploaded the document to the post too. Let me know if the image or attachment aren't showing, I am new here.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: I need to extract dates from a column that contains other information. Format varies.

    Formula for B2 =TRIM(SUBSTITUTE(RIGHT(I2,LEN(I2)-FIND("-",I2)),"-","/"))*1

    That turns the date into a number.

    Format column B as you want it displayed.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    11-30-2021
    Location
    UK
    MS-Off Ver
    Office 365 for Enterprise
    Posts
    5

    Re: I need to extract dates from a column that contains other information. Format varies.

    Thank you for the quick reply! It worked for the first few, then started forgetting the days and only accurately converting month and year. Not sure why, the format doesn't differ at all from I6 to I7. I made the whole B column follow the same formula and noticed the same issue all the way down.

    Again thanks for a quick response. Attachment 757447

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,816

    Re: I need to extract dates from a column that contains other information. Format varies.

    Attach the workbook, please, not a picture of it.

    Administrative Note:

    Members will tailor the solutions they offer to the version of Office (Excel) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your version is for Mac, please also state this. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,915

    Re: I need to extract dates from a column that contains other information. Format varies.

    try below formula
    =LOOKUP(9^9,RIGHT(SUBSTITUTE(I2," ",""),{1,2,3,4,5,6,7,8,9,10})+0)
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  6. #6
    Registered User
    Join Date
    11-30-2021
    Location
    UK
    MS-Off Ver
    Office 365 for Enterprise
    Posts
    5

    Re: I need to extract dates from a column that contains other information. Format varies.

    I have attached the file in the initial. I've updated my office version. I attached an image of the result of the formula suggested above.

  7. #7
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: I need to extract dates from a column that contains other information. Format varies.

    That does not work either because some of your entries do not have either of those characters.

    So try

    B2 =SUBSTITUTE(RIGHT(I2,LEN(I2)-MIN(IFERROR(FIND({0,1,2,3,4,5,6,7,8,9},I2),99))+1),"-","/")*1
    Last edited by mehmetcik; 11-30-2021 at 08:09 AM.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,816

    Re: I need to extract dates from a column that contains other information. Format varies.

    Try this instead:

    =SUBSTITUTE(TRIM(SUBSTITUTE(RIGHT(I2,8),"–","")),"-","/")*1

  9. #9
    Registered User
    Join Date
    11-30-2021
    Location
    UK
    MS-Off Ver
    Office 365 for Enterprise
    Posts
    5

    Re: I need to extract dates from a column that contains other information. Format varies.

    Thank you Samba and Mehmetcik, both formulas worked for me. I'll do half and half . I've added reputation.

    Have a good day.

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,816

    Re: I need to extract dates from a column that contains other information. Format varies.

    What about mine? It's a bit shorter.

  11. #11
    Registered User
    Join Date
    11-30-2021
    Location
    UK
    MS-Off Ver
    Office 365 for Enterprise
    Posts
    5

    Re: I need to extract dates from a column that contains other information. Format varies.

    Sorry, it hadn't refreshed when I marked as solved. Thank you also, third and third and third?

  12. #12
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: I need to extract dates from a column that contains other information. Format varies.

    Ali's formula returns errors in B55 to B74

    So try

    B2 =SUBSTITUTE(RIGHT(I2,LEN(I2)-MIN(IFERROR(FIND({0,1,2,3,4,5,6,7,8,9},I2),99))+1),"-","/")*1

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,816

    Re: I need to extract dates from a column that contains other information. Format varies.

    ... third and third and third?
    Don't understand - sorry.

    I've added reputation.
    That's kind - thank you.

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,816

    Re: I need to extract dates from a column that contains other information. Format varies.

    Quote Originally Posted by mehmetcik View Post
    Ali's formula returns errors in B55 to B74
    Damn!

+ 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. Creating a Sub that consolidate information from varies workbooks to one
    By Johannesk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-27-2020, 11:10 AM
  2. Replies: 4
    Last Post: 01-24-2017, 07:15 PM
  3. [SOLVED] Macro to extract information from exported file from one format table into another format
    By gmeikle in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-24-2017, 02:08 PM
  4. Array formula to extract information in-between two dates
    By Kayees in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-25-2013, 05:00 AM
  5. Replies: 1
    Last Post: 03-23-2013, 08:46 AM
  6. Replies: 7
    Last Post: 05-15-2012, 01:59 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