+ Reply to Thread
Results 1 to 8 of 8

Deconcatenate date

  1. #1
    Registered User
    Join Date
    07-18-2016
    Location
    San Diego
    MS-Off Ver
    2007
    Posts
    13

    Deconcatenate date

    I downloaded a set of transactions and the date ended up in two similar text formats, e.g.:

    JAN12017 (8 char) and
    JAN1020I7 (9 char).

    I'd like the date to be reformatted into numeric, specifically

    1-JAN-17 (or 2017) and
    10-JAN-17 ".

    i have >600 dates to reformat so I need a formula. Although I'm familiar with most aspects of Excel, nothing I've tried works completely. Any ideas? Thanks.


    Pallando
    San Diego
    Last edited by Pallando_II; 06-07-2017 at 02:41 AM. Reason: clarity

  2. #2
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Deconcatenate date

    Assume you have data in A1 then Try

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


    Drag down!!
    Last edited by shukla.ankur281190; 06-07-2017 at 03:26 AM. Reason: Changes as per Mr.Ford post #4
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,967

    Re: Deconcatenate date

    Another option...
    A
    B
    1
    JAN12017
    1/1/2017
    2
    JAN102017
    1/10/2017

    B1=DATEVALUE(MID(A1,4,IF(LEN(A1)=8,1,2))&LEFT(A1,3)&RIGHT(A1,4))
    Note that in your 2nd example, you have 20I7 (letter I) not 2017 (number 1)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,967

    Re: Deconcatenate date

    Quote Originally Posted by shukla.ankur281190 View Post
    Assume you have data in A1 then Try

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


    Drag down!!
    That is still text, not a date

  5. #5
    Registered User
    Join Date
    07-18-2016
    Location
    San Diego
    MS-Off Ver
    2007
    Posts
    13

    Re: Deconcatenate date

    Keen "I" Mr. Dibbins. Was not intentional.

  6. #6
    Registered User
    Join Date
    07-18-2016
    Location
    San Diego
    MS-Off Ver
    2007
    Posts
    13

    Re: Deconcatenate date

    Mr Ankur's formula conversion provided a numeric result for me, albeit the date's being in its 'basic' format (#days from 1900); then simple reformat.

    Just saw he edited it per your comment, which is when I probably used it.
    Last edited by Pallando_II; 06-07-2017 at 06:05 PM.

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,967

    Re: Deconcatenate date

    Happy to help, thanks for the feedback
    (good pun there, too )

  8. #8
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Deconcatenate date

    Hi all- Ankur, I liked the way you coerced the text to date. Here's a slightly tighter version of your formula:
    =--(MID(A1,4,LEN(A1)-7)&"-"&LEFT(A1,3)&"-"&RIGHT(A1,4))

    And Ford recognized delimiters weren't required! Combining the best of both:
    =--(MID(A1,4,LEN(A1)-7)&LEFT(A1,3)&RIGHT(A1,4))

    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Last edited by leelnich; 06-07-2017 at 09:39 PM.

+ 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. Deconcatenate?
    By jarett in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-22-2015, 04:50 PM
  2. Counting if data falls on date between Start Date, End Date or Possible End Date
    By JessHasQuestions in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 07-26-2014, 08:01 AM
  3. Replies: 1
    Last Post: 10-02-2012, 02:42 PM
  4. Replies: 1
    Last Post: 09-28-2012, 08:52 AM
  5. Macro code to deconcatenate
    By vxg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2011, 10:20 AM
  6. Replies: 7
    Last Post: 11-16-2008, 05:48 PM
  7. deconcatenate
    By TP in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-13-2006, 11:00 AM

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