+ Reply to Thread
Results 1 to 7 of 7

8 digit date (text with leading zeros) to date format?

  1. #1
    Registered User
    Join Date
    02-27-2015
    Location
    Philadelphia, PA USA
    MS-Off Ver
    2010
    Posts
    3

    8 digit date (text with leading zeros) to date format?

    Hello all,

    I am trying to get a column of 8 digit text to dates.

    The text to column wizard doesn't work because I have leading zeros.

    The dates are in the format MMDDYYYY in text.

    I saw some formulas on here but they are all with YYYY first, and I don't know how to change the formulas to the YYYY last.

    Can anyone help with a formula?

    Thanks much

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

    Re: 8 digit date (text with leading zeros) to date format?

    Assuming the date is in cell A2, then you can use this formula (e.g. in B2):

    =DATE(RIGHT(A2,4),LEFT(A2,2),MID(A2,3,2))

    Apply a date format to that cell as you would prefer, then copy it down.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    02-27-2015
    Location
    Philadelphia, PA USA
    MS-Off Ver
    2010
    Posts
    3

    Re: 8 digit date (text with leading zeros) to date format?

    Yikes man, sorry but that leading zero is messing up that formula also. It works with a date such as 11112011 to 11/11/2011 but it doesn't work with a date like 08222011 to either 08/11/2011 or 8/11/2011.

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: 8 digit date (text with leading zeros) to date format?

    This works here on a list of 8 digit text numbers representing dates:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Format as date.

    You can change the "dd/mm/yyyy" to whatever date format you want to use. This one is day month year. If you want month day year this is how it would go:

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


    Format as date.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  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,852

    Re: 8 digit date (text with leading zeros) to date format?

    Maybe the cell is just formatted to show a leading zero when the real value is only 7 digits. If so, try this formula:

    =DATE(RIGHT(A2,4),LEFT(A2,IF(LEN(A2)=8,2,1)),MID(A2,IF(LEN(A2)=8,3,2),2))

    Hope this helps.

    Pete

  6. #6
    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: 8 digit date (text with leading zeros) to date format?

    Another way, with or without a leading 0:

    Row\Col
    A
    B
    C
    1
    02272015
    02/27/2015
    B1: =--TEXT(A1, "00-00-0000")
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Registered User
    Join Date
    02-27-2015
    Location
    Philadelphia, PA USA
    MS-Off Ver
    2010
    Posts
    3

    Re: 8 digit date (text with leading zeros) to date format?

    This did it. Thanks!!

    Sorry, forgot to reply with quote. Pete_UK's last formula worked!

+ 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] Changing 5-digit Zip to 3-digit zip without losing leading zeros
    By Jennifer C in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-05-2014, 09:26 AM
  2. format cell to show leading zeros and make cell a three digit fiel
    By Kristin in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-28-2006, 04:45 PM
  3. Replies: 1
    Last Post: 05-04-2005, 02:06 PM
  4. [SOLVED] zero supress leading zeros when chg format from text to number
    By HeatherO in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-27-2005, 08:06 PM
  5. leading zeros in text format
    By BigBrook in forum Excel General
    Replies: 3
    Last Post: 02-04-2005, 08:06 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