+ Reply to Thread
Results 1 to 3 of 3

Convert String to a Proper Date format

  1. #1
    Registered User
    Join Date
    10-31-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    41

    Convert String to a Proper Date format

    I have an input string because of the addin I use that needs to be in this format YearMonthDay such as 201307 or 20130719. It sometimes does not have the day, but just the month. Any thoughts on how I could convert this into a proper excel format?

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Convert String to a Proper Date format

    hi Boo123, something like this perhaps:
    =IF(LEN(A1)=6,TEXT(A1&"01","00-00-00"),TEXT(A1,"00-00-00"))+0

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    10-31-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Convert String to a Proper Date format

    Quote Originally Posted by benishiryo View Post
    hi Boo123, something like this perhaps:
    =IF(LEN(A1)=6,TEXT(A1&"01","00-00-00"),TEXT(A1,"00-00-00"))+0
    Ben, that worked nicely with a slight tweak:

    =IF(LEN(F5)=6,TEXT(F5,"00-00"),TEXT(F5,"00-00-00"))

+ Reply to 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