+ Reply to Thread
Results 1 to 5 of 5

transforming a text date/year into a date

  1. #1
    Forum Contributor
    Join Date
    11-22-2006
    MS-Off Ver
    2010
    Posts
    201

    transforming a text date/year into a date

    Hi, I have a file with a text field that says Apr1516, Dec1516 or Jan1516 for example.

    I want to create a new column that will translate that into an actual date, so, for example:

    Apr1516 would translate to 01/04/2015, ie using the first 2 digits for the year.
    Dec1516 would be 01/12/2015, but
    Jan1516 would be 01/01/2016 because that should use the last 2 digits for the year.


    Any help in terms of how I would automate that would be great.

    Thanks
    Lucy

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,647

    Re: transforming a text date/year into a date

    I have assumed that the FY ends in March. You didn't say.....


    =DATE((0+(20&IF(MONTH(1&LEFT(A1,3))<=3,MID(A1,6,2),MID(A1,4,2)))),MONTH(1&LEFT(A1,3)),1)

    copied down.

    PS, please take a moment to amend your profile to show your Excel version AND your general location. Both influence solutons offered.
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 02-20-2018 at 10:54 AM.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Contributor
    Join Date
    11-22-2006
    MS-Off Ver
    2010
    Posts
    201

    Re: transforming a text date/year into a date

    Great, thank you.

    I changed the formulae to DATE((0+(20&IF(MONTH(1&LEFT(A1,3))<=3,MID(A1,6,2),MID(A1,4,2)))),MONTH(1&LEFT(A1,3)),1)

    Thanks!

  4. #4
    Forum Contributor
    Join Date
    07-04-2012
    Location
    Al Khor, Qatar
    MS-Off Ver
    Excel 2013
    Posts
    101

    Re: transforming a text date/year into a date

    Please try the following:

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


    Text field is in ColA

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,647

    Re: transforming a text date/year into a date

    You're welcome. Where was the change that you made??



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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: 3
    Last Post: 10-06-2015, 05:30 PM
  2. Replies: 1
    Last Post: 04-22-2015, 08:08 AM
  3. Replies: 4
    Last Post: 11-26-2014, 09:22 PM
  4. [SOLVED] Formula to compare date (including month and year) from a listed date to today's date
    By mhewitson15 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-11-2014, 05:31 PM
  5. [SOLVED] Plotting Year wise maximum value & occurance date - the input date is in text format.
    By thilag in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-08-2014, 06:34 AM
  6. Replies: 3
    Last Post: 08-14-2012, 05:14 AM
  7. transforming a date
    By [email protected] in forum Excel General
    Replies: 4
    Last Post: 08-01-2006, 12:15 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