+ Reply to Thread
Results 1 to 8 of 8

Date Conversion

  1. #1
    Registered User
    Join Date
    11-02-2011
    Location
    Midwest, US
    MS-Off Ver
    Excel 2010
    Posts
    43

    Date Conversion

    I have a series of dates that I need to convert. What is the best formula or way to convert the following. I have included some examples below.

    The 110 at the beginning represents 2010 and the 111 at the beginning represents 2011.

    110356
    110351
    110364
    111003

    Also would the above actually be considered Julian dates? I have seen them with 2 digits and 4 digits representing the year but not normally 3.
    Last edited by dotsofcolor; 02-06-2012 at 12:02 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Date Conversion

    What dates do those strings convert to?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    11-02-2011
    Location
    Midwest, US
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Date Conversion

    The strings should convert to the following I believe if I am converting them correctly.

    110356 12/22/2010
    110351 12/17/2010
    110364 12/30/2010
    111003 1/3/2011

    I have this formula to work with which seems to be working but I can't help wondering if this is the best way to work with these types of Julian Dates especially when there are as many as I have to work with, and it's a lot.

    Please Login or Register  to view this content.
    Any suggestions on another method to work with this?

  4. #4
    Registered User
    Join Date
    10-13-2011
    Location
    Northern California
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Date Conversion

    Quote Originally Posted by dotsofcolor View Post
    ...
    The 110 at the beginning represents 2010 and the 111 at the beginning represents 2011.

    110356
    110351
    110364
    111003

    Also would the above actually be considered Julian dates? I have seen them with 2 digits and 4 digits representing the year but not normally 3.
    You'd need to specify the format, not anyone else here. If the last 3 digits are Julian dates, then it appears the next 2 digits before that would be the year within the specified century, and I'd guess the 1 meant 2000 thru 2099, so 0 would mean 1900 thru 1999, so presumably 2-digit years would be between 1900 and 1999 since the leading 0 for 099002 for 2 Jan 1999 may have been dropped. Further, I'd guess 4-digit years are as-is, so 2011364 would be 30 Dec 2011.

    If so, try

    =DATE(IF(LEN(A1)<7,1899,0)+INT(A1/1000),12,31)+MOD(A1,1000)

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,604

    Re: Date Conversion

    This one "seems" to work:
    =DATE(MID(A1,2,2)+2000,1,0)+RIGHT(A1,3)
    Ben Van Johnson

  6. #6
    holin_168
    Guest

    Re: Date Conversion

    Please check my attached file for solution. You need formula==DATE(20&MID(D2,2,2),1+IFERROR(MATCH(VALUE(RIGHT(D2,3)),D5:D16,1),0),VALUE(RIGHT(D2,3))-IFERROR(VLOOKUP(MATCH(VALUE(RIGHT(D2,3)),D5:D16,1),B5:D16,3,FALSE),0))



    You may also interest in:
    Extract report from a date range in Ms Excel

    Combine duplicate Data in Ms Excel
    Attached Files Attached Files
    Last edited by holin_168; 02-04-2012 at 12:31 AM.

  7. #7
    Registered User
    Join Date
    10-13-2011
    Location
    Northern California
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Date Conversion

    Quote Originally Posted by protonLeah View Post
    This one "seems" to work:
    =DATE(MID(A1,2,2)+2000,1,0)+RIGHT(A1,3)
    It should unless there were any dates in the 1900s. Then it may fail.

  8. #8
    Registered User
    Join Date
    11-02-2011
    Location
    Midwest, US
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Date Conversion

    I tried them all and they worked great. All of them helped me with the direction I needed to go and I learned a few things along the way. Always great help in this forum and it's really appreciated.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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