+ Reply to Thread
Results 1 to 4 of 4

First-timer question--custom date from a string of numbers?

  1. #1
    Registered User
    Join Date
    05-05-2014
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    1

    First-timer question--custom date from a string of numbers?

    Hi, just found this forums searching for help online. I think I will be a regular here.

    This may be a scripting question, but I'd like to change a column of dates formatted like this: "11130723", where character 1 is the century, 2 and 3 are the year, four and five are the month, and six and seven are the day (such that the date in the example is 7/23/2013--century "1" is the 21st century) into a more-commonly accepted, easier-to-read format.

    ...I cannot figure out how, short of opening four new columns, doing a mid in two columns to get the year and month, a right to get the date, then concatenating those three with slashes, then copy/paste-ing over that to get a date. I can do it pretty quick once I get the first row set up, but if I have seven or eight columns to format, well...I'd like a quicker way.

    Anyone have any ideas?

    Thanks in advance.

  2. #2
    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,946

    Re: First-timer question--custom date from a string of numbers?

    Hi and welcome to the forum

    Maybe this?
    =DATE(MID(A1,3,2),MID(A1,LEN(A1)-3,2),RIGHT(A1,2))
    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

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,638

    Re: First-timer question--custom date from a string of numbers?

    I think you have an extra "1" in your example. But, maybe:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor
    Join Date
    02-20-2014
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    170

    Re: First-timer question--custom date from a string of numbers?

    Assuming your date is in A1:

    =DATE((MID(A1,1,1))&MID(A1,2,2),MID(A1,4,2),MID(A1,6,2))

    I also think you had an extra 1 in the example number you gave? That one had 8 digits, not 7.

+ 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. string of numbers to a date
    By John Ford in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-19-2013, 11:39 AM
  2. [SOLVED] Extracting date from string of numbers
    By ormerods in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-21-2013, 10:50 AM
  3. Calculate week numbers from custom date
    By Lord Tink in forum Excel General
    Replies: 10
    Last Post: 06-06-2012, 08:57 AM
  4. Custom Formatting numbers question
    By Junkyard Engineer in forum Excel General
    Replies: 2
    Last Post: 07-14-2005, 04:05 PM
  5. custom date format question
    By xcelvisitor in forum Excel General
    Replies: 1
    Last Post: 05-14-2005, 07:03 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