+ Reply to Thread
Results 1 to 10 of 10

Mid function to create birth dates

  1. #1
    Registered User
    Join Date
    10-27-2016
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2016
    Posts
    4

    Mid function to create birth dates

    Hi, please help as I do not know which way anymore.
    I have a range of unique identification numbers which I need to translate into birth dates.
    i.e 0702035006081, 8502035006087 - 1st 6 digits are what I'm after to do the above.
    Please help with formula as my logic (IF function) does no return the correct results: =MID(A4;5;2)&"/"&MID(A4;3;2)&"/"&IF(MID(A4;1;2)>1;"19";"20")&MID(A4;1;2)

    So 0702035006081 corresponds to 2007/02/03
    8502035006087 corresponds to 1985/02/03
    Previous formula defaults all to the year 1900 (i.e 1907 & 1985)

  2. #2
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: Mid function to create birth dates

    =TEXT(DATEVALUE(MID(A4,5,2)&"/"&MID(A4,3,2)&"/"&MID(A4,1,2)),"d mmm yyyy")
    Frob first, tweak later

  3. #3
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: Mid function to create birth dates

    or, format the cells as date and use this
    =DATEVALUE(MID(A4,5,2)&"/"&MID(A4,3,2)&"/"&MID(A4,1,2))

    Good for dates after 1930

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Mid function to create birth dates

    Or perhaps ...

    A
    B
    C
    1
    0702035006081
    03 Feb 2007
    B1: =--(TEXT(MID(A1, 3, 4), "00-00-") & LEFT(A1, 2))
    2
    8502035006087
    03 Feb 1985
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    10-27-2016
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2016
    Posts
    4

    Re: Mid function to create birth dates

    Still doesn't work #VALUE error.

  6. #6
    Registered User
    Join Date
    10-27-2016
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2016
    Posts
    4

    Re: Mid function to create birth dates

    I need the data to display like this:
    A B
    0702035006087 03/02/2007
    8509120866079 12/09/1985

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,203

    Re: Mid function to create birth dates

    Formula in #3 works.
    Last edited by JohnTopley; 10-27-2016 at 10:36 AM.

  8. #8
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,911

    Re: Mid function to create birth dates

    Quote Originally Posted by Desire85 View Post
    I need the data to display like this:
    A B
    0702035006087 03/02/2007
    8509120866079 12/09/1985
    Try ...

    =--(TEXT(IF(--LEFT(A1,2)>16,19,20)&LEFT(A1,6),"0000\/00\/00"))

  9. #9
    Registered User
    Join Date
    10-27-2016
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2016
    Posts
    4

    Re: Mid function to create birth dates

    Quote Originally Posted by JohnTopley View Post
    Formula in #3 works.
    Thank you!!!!
    Cell was not formatted to correct date.

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,203

    Re: Mid function to create birth dates

    Thanks are due to Neil (by clicking * Add Reputation)

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

+ 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] If a Date of Birth is Between Two Dates do This
    By Choby in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-21-2016, 11:26 AM
  2. [SOLVED] Birth Dates and Ages
    By sambo24 in forum Excel General
    Replies: 6
    Last Post: 12-23-2013, 09:59 AM
  3. [SOLVED] Sorting Dates of Birth
    By EXCELNEWCOMER in forum Excel General
    Replies: 14
    Last Post: 11-12-2013, 06:48 AM
  4. [SOLVED] Calculating a future dates based on dates or birth.
    By CDobby in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 07-31-2012, 11:22 AM
  5. Excel 2007 : finding current age with Dates of Birth
    By Cathie522 in forum Excel General
    Replies: 2
    Last Post: 12-06-2010, 05:07 PM
  6. Date of birth sum(born between certain dates)
    By darkobird84 in forum Excel General
    Replies: 7
    Last Post: 06-22-2010, 09:15 AM
  7. Replies: 3
    Last Post: 02-05-2009, 03:56 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