+ Reply to Thread
Results 1 to 3 of 3

Extract the date from a text field and make it into a date format

  1. #1
    Registered User
    Join Date
    05-19-2021
    Location
    Alabama, US
    MS-Off Ver
    2016
    Posts
    1

    Extract the date from a text field and make it into a date format

    I have a text field that has the following data format:

    Completed|John Doe|Monday, May 17th 2021, 3:15:19 pm|

    I need to extract just the date and then make that into a date format.
    Need to do this in one formula. I'm trying to 'copy' this formula into a calculated Sharepoint list.

    Thanks!

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

    Re: Extract the date from a text field and make it into a date format

    One example is not much to work on. Will the month always be 3 letters (e.g. Dec for December), or the full month name.

    You can extract the date string using MID, starting after the first comma, and then a series of SUBSTITUTE functions around that can get rid of the ordinals (th, st, nd, rd etc.), and then DATEVALUE around that should be able to convert it into a proper date with whatever format you like (or you could use TEXT if you are exporting it to another application).

    It would help if you could attach a sample Excel workbook showing a few other examples, so we can see what variations you are likely to be faced with - see the yellow banner at the top of the screen for details of how to do this.

    Hope this helps.

    Pete

  3. #3
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,410

    Re: Extract the date from a text field and make it into a date format

    IF your data is always structured as you showed in your single example and the date/time as the last text followed by an "pipe" (|) symbol, then give this formula a try...
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Note: This formula will return a serial date time so you will have to format the cell to display it with the date and time format of your choosing.

+ 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: 2
    Last Post: 11-21-2018, 12:38 PM
  2. Date format not working as expected when extract from text string
    By iantix in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-17-2017, 12:37 PM
  3. [SOLVED] Concatenate a date field keeping the date format
    By rrcrossman in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-13-2016, 04:28 PM
  4. [SOLVED] Changing a Text Field with a Date to an Actual Date Field
    By chcalissie in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-22-2014, 09:54 AM
  5. Replies: 1
    Last Post: 04-11-2013, 12:22 AM
  6. Extract a date from a field and append another field's data
    By Leroy221 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-07-2012, 11:35 AM
  7. Replies: 2
    Last Post: 01-17-2010, 10:39 AM

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