+ Reply to Thread
Results 1 to 8 of 8

Convert to standard date

  1. #1
    Registered User
    Join Date
    09-16-2021
    Location
    OC, CA
    MS-Off Ver
    Office 365
    Posts
    2

    Convert to standard date

    Looking for help with writing a formula to convert a string to a date. The string presents itself as such in the data I download: Sep-16-2021

    Example is attached
    Attached Files Attached Files

  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,426

    Re: Convert to standard date

    Here's one way of converting the date:

    =DATE(RIGHT(E2,4),INT((FIND(LEFT(E2,3),"JanFebMarAprMayJunJulAugSepOctNovDec")-1)/3)+1,MID(E2,5,2))

    Format the result in the style you prefer, then copy down as required.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    09-16-2021
    Location
    OC, CA
    MS-Off Ver
    Office 365
    Posts
    2

    Re: Convert to standard date

    Thank you!

    I get the Year & Day portion of the formula. Can you walk me through how the INT function is used to get the month? Please.


    INT((FIND(LEFT(E2,3),"JanFebMarAprMayJunJulAugSepOctNovDec")-1)/3)

  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,426

    Re: Convert to standard date

    The FIND function will determine the character where the 3 letters representing the month can be found, so it will return 1 for Jan, 4 for Feb, 7 for Mar, and so on. 1 is subtracted from this number (giving 0, 3, 6 etc. for those months), and then this is divided by 3 to return 0, 1, 2 through the INT function, and then 1 is added back in, so those months will return 1, 2, 3 and so on. That part of the formula thus returns the month number represented by the 3-letter month.

    Hope this helps.

    Pete

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

    Re: Convert to standard date

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

  6. #6
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,418

    Re: Convert to standard date

    Formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2019
    Posts
    4,542

    Re: Convert to standard date

    Another option:=DATEVALUE(REPLACE(RIGHT(E2,7),3,1,"-"&LEFT(E2,3)&"-"))
    or =--REPLACE(RIGHT(E2,7),3,1,"-"&LEFT(E2,3)&"-")
    Last edited by josephteh; 09-17-2021 at 10:22 AM.

  8. #8
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2019
    Posts
    4,542

    Re: Convert to standard date

    One more formula:=DATE(RIGHT(E2,4),MATCH(LEFT(E2,3),{"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"},0),MID(E2,5,2))

+ 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. Convert non standard time formats to a standard time format
    By vemulasandeep in forum Excel General
    Replies: 16
    Last Post: 10-27-2020, 08:34 AM
  2. Convert Multiple Date Formats Into Standard Format
    By Abdur_rahman in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-29-2016, 02:04 PM
  3. How to convert julian date to standard date
    By dolphino in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-29-2015, 04:22 AM
  4. Convert Julian time and year to standard date and time
    By gozo in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 09-11-2014, 06:42 AM
  5. Convert dates like 2007.15 into standard format
    By Deviad in forum Excel General
    Replies: 9
    Last Post: 05-11-2010, 08:02 AM
  6. Convert Referenced Cells to Standard Values
    By smlaff01 in forum Excel General
    Replies: 3
    Last Post: 11-14-2007, 01:07 PM
  7. Replies: 0
    Last Post: 08-23-2005, 12:22 PM

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