+ Reply to Thread
Results 1 to 8 of 8

Extract date frm first 6 characters from right to Left

  1. #1
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,709

    Extract date frm first 6 characters from right to Left

    I am have tried setting up a formula to extract the date of birth from the first 6 characters starting from right to left



    Eg 840723008147 after extraction should be 23/07/1984
    200120305195 after extraction should be 20/01/2020


    I need to se to the year as four characters, but the ID for the yea is only two characters

    It would be appreciated if someone could assist me

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,959

    Re: Extract date frm first 6 characters from right to Left

    How far back into the last millenium (1900s) do your dates go?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,911

    Re: Extract date frm first 6 characters from right to Left

    try
    =(MID(A1,5,2)&"/"&MID(A1,3,2)&"/" &LEFT(A1,2))+0
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Extract date frm first 6 characters from right to Left

    Hi

    One way

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

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,679

    Re: Extract date frm first 6 characters from right to Left

    If you wanted proper dates, then you could use this in B1:

    =DATE(LEFT(A1,2)+IF(LEFT(A1,2)+0<30,2000,1900),MID(A1,3,2),MID(A1,5,2))

    Note that this would return years in the range 1930 to 2029. but if these are dates of birth then presumably you would want to change the <30 to <21, to give a range from 1921 - 2020.

    Hope this helps.

    Pete

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

    Re: Extract date frm first 6 characters from right to Left

    Or try:

    =--TEXT(IF(--LEFT(A1,2)<21,20,19)&LEFT(A1,6),"0000-00-00")

  7. #7
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,709

    Re: Extract date frm first 6 characters from right to Left

    Hi Glen

    It goes back as far as 1930


    Regards


    Howard

  8. #8
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,709

    Re: Extract date frm first 6 characters from right to Left

    Hi Guys

    Many thanks for the 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] Extract date from text string between certain characters
    By iantix in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-18-2020, 11:14 AM
  2. [SOLVED] How to use the LEFT function to extract just characters
    By sx200n in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-03-2018, 12:15 PM
  3. Replies: 6
    Last Post: 06-26-2017, 09:04 PM
  4. [SOLVED] Vlookup to extract last five characters or include only first 5 characters
    By Michael Lerena in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-10-2017, 04:53 PM
  5. Use LEFT formula to extract text preceding ONE OF TWO possible characters
    By potejam in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-22-2013, 08:05 PM
  6. [SOLVED] Extract left characters from string with exception of 2 right characters
    By sweetkel23 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-16-2012, 10:45 PM
  7. HOW DO I EXTRACT ALL CHARACTERS AFTER 5 CHARACTERS ON LEFT
    By GRYSYF in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-12-2005, 07:05 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