+ Reply to Thread
Results 1 to 7 of 7

issue with converting number to date need help!

  1. #1
    Forum Contributor
    Join Date
    09-12-2013
    Location
    chicago, illinois
    MS-Off Ver
    Excel 2010
    Posts
    109

    issue with converting number to date need help!

    Hello all, i have an issue with converting a type of ... julian date... to a regular date and my brain must simply not function today so i am requesting help.

    i have a serial number: 09121673 for example

    09 is the month 12 is the year 167 is the day and the last digit is ignored.

    i am using this formula i found on here to do the date conversion: =("1/1/"&(IF(LEFT(A4,2)*1<20,2000,1900)+LEFT(A4,2)))+MOD(A4,1000)-1

    it works but the month and year are switched i believe and again, i simply am having a "brain fart" moment today and cannot seem to figure it out!

    thanks!!

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: issue with converting number to date need help!

    Try:

    =DATE(2000 -- MID(A1,3,2),1,1)--MID(A1,5,3)-1

    This assumes that:

    01120013 is really 1 January 2012
    Gary's Student

  3. #3
    Forum Contributor
    Join Date
    09-12-2013
    Location
    chicago, illinois
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: issue with converting number to date need help!

    Thanks for the reply! ... that gets the year correct but the month and day are still not working :-/

  4. #4
    Registered User
    Join Date
    10-09-2013
    Location
    New Delhi
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: issue with converting number to date need help!

    HI,
    first of all I am considering the value "09121673". Since it is going to be a Julian date so month is insignificant. so our only consideration will be "12" and "167". So here is the formula which might be useful for you.

    Please Login or Register  to view this content.

  5. #5
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: issue with converting number to date need help!

    There is a problem with the data.......the year is 2012 (because of the 12) and the 167th day of 2012 is June 15 2012, but your data shows the month should be September (because of the leading 09)

  6. #6
    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,974

    Re: issue with converting number to date need help!

    Im confused...
    09 is the month 12 is the year 167 is the day and the last digit is ignored
    if the month is already 9 (September), do you then want to calc the date 167 days from that?

    what answer are you expecting?
    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

  7. #7
    Forum Contributor
    Join Date
    09-12-2013
    Location
    chicago, illinois
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: issue with converting number to date need help!

    yes, i believe i goofed and explained it incorrectly...i was also recently told it is NOT an actual julian date *sigh* lol. it is simply serialized as month, year, day, so i altered it to this and simply inserted a "/"

    =(MID(A1,1,2)&"/"&MID(A1,5,2)&"/"&MID(A1,3,2))

    thanks for everyones help!

+ 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. [SOLVED] Converting date serial number to date
    By Shaky01 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-26-2013, 11:24 PM
  2. Converting a date serial number back to a date within a string
    By bharris77 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-22-2012, 01:15 PM
  3. Issue converting string to number..
    By cummins in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-08-2011, 04:07 PM
  4. Converting Text to number issue
    By Dr Mambo in forum Excel General
    Replies: 3
    Last Post: 03-17-2009, 08:29 AM
  5. Converting Text to Number & Summing Issue
    By JumpingMattFlash in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-31-2006, 09:23 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