Closed Thread
Results 1 to 8 of 8

Decipher 10 digit string to get date

  1. #1
    Forum Contributor
    Join Date
    12-27-2007
    Posts
    106

    Decipher 10 digit string to get date

    Hi

    I got codes that have 10 digits: e.g. 0921453591

    From which:

    0921453591 = dispatch - to be ignored.
    0921453591 = date - 21st
    0921453591 = month - 4 - (April)
    0921453591 = year - 5 - 2005

    so the figures from code will be: 21/4/5 - which is then interpreted as a date 21/04/05

    Months - 1=jan, 2=feb etc X=oct, Y=nov, Z=dec

    e.g. 0913Y53774 = date 13/11/05

    So if the code is placed into col A, what formula/string/syntax do I use to get the date col B automatically?

    All help will be much appreciated.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Decipher 10 digit string to get date

    Try:

    Please Login or Register  to view this content.
    where A1 = code cell

    You may have to format cell to appear as date.


    Note:

    This assumes dates within year range 2000 and 2009. What is code for year 2010 or 2011 or 1999, etc... Are these possible?
    Last edited by NBVC; 03-10-2009 at 08:56 AM. Reason: Add formatting cell note.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Decipher 10 digit string to get date

    Hi,

    Try this:

    =DATEVALUE(MID(A1,3,2)&"/"&MATCH(MID(A1,5,1),{"1","2","3","4","5","6","7","8","9","X","Y","Z"},0)&"/"&"200"&MID(A1,6,1))
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  4. #4
    Forum Contributor
    Join Date
    12-27-2007
    Posts
    106

    Re: Decipher 10 digit string to get date

    Hi

    NBVC quoted:

    This assumes dates within year range 2000 and 2009. What is code for year 2010 or 2011 or 1999, etc... Are these possible?
    Answer:

    The date found by the codes is the actual packaging date - the shelf life of the product is 3 years from the date of package.

    One MAJOR assumption is being made here - that is that the reptuable company doesn't dispatch goods out of date. So with this in mind: if I get a code showing the year as 5 and that the current year is 2009 - then the dispatch date has to be the first year ending in "5" prior to 2009 - which will be 2005. Bearing in mind that the shelf life is 3 years - product expires in 2008 - so it has expired!! That is what I'm trying to work out! Are the company sending me goods out of date or am I not rotating my stock?

    Hope that explains.

    Also is it possible to put that into the code?? Interesting???
    Last edited by tony0710; 03-10-2009 at 12:34 PM.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Decipher 10 digit string to get date

    Quote Originally Posted by tony0710 View Post
    Hi

    NBVC quoted:



    Answer:

    The date found by the codes is the actual packaging date - the shelf life of the product is 3 years from the date of package.

    One MAJOR assumption is being made here - that is that the reptuable company doesn't dispatch goods out of date. So with this in mind: if I get a code showing the year as 5 and that the current year is 2009 - then the dispatch date has to be the first year ending in "5" prior to 2009 - which will be 2005. Bearing in mind that the shelf life is 3 years - product expires in 2008 - so it has expired!! That is what I'm trying to work out! Are the company sending me goods out of date or am I not rotating my stock?

    Hope that explains.

    Also is it possible to put that into the code?? Interesting???
    Do you mean something like this:

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    12-27-2007
    Posts
    106

    Re: Decipher 10 digit string to get date

    wow

    That works a treat - though I would still like to see the packaging date.

    Col A: code
    Col B: Packaing date
    Col C: Expired or not

    Better still if the whole even can be updated daily, so that perhaps Col C could say something along the lines "X number of days to expire" or "Y number of days expired"

    Sorry to be a pain!!

  7. #7
    Forum Contributor
    Join Date
    12-27-2007
    Posts
    106

    Re: Decipher 10 digit string to get date

    *** bumped ***

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Decipher 10 digit string to get date

    Hello tony0710,

    Your original question has been answered. You are now asking for more information that was not included in your original post. You need to make a new post and include all data code that pertains to your question. This thread will be closed. Please read the forum's rules on posting.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

Closed Thread

Thread Information

Users Browsing this Thread

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

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