+ Reply to Thread
Results 1 to 5 of 5

Coverting numbers to date format

  1. #1
    Registered User
    Join Date
    09-28-2009
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    3

    Post Coverting numbers to date format

    Please Hep!

    Imported a XML file into MS Excel 2003, the file contains dates expressed as a numbers i.e 20091225. I'm trying to convert this number in excel into a date, so I can eventually aggregate by day of week.

    Example:
    20091225 covert to 2009/12/25

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Coverting numbers to date format

    To alter the initial values

    Highlight the column in question and run Data -> Text to Columns -> Step 3 choose Date -> YMD and click Finish.

    If you prefer to store dates in adjacent column

    B1: =0+TEXT(A1,"0000\/00\/00")
    copied down
    (assumes your values are YYYYMMDD ie 20090309 for 9th March 2009 - ie leading zero for Month and Day when < 10)

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Coverting numbers to date format

    You don't show how the data is being imported, so let me first remind you that if you are using any of the Excel import wizards, then you can tell Excel that the data in that column is DATES on the final Screen 3 of the import tool.

    On that final screen, select the column with the dates, and select DATE: as the column data format, and select YMD as the data style.

    Doing this will cause the data to arrive in your spreadsheet as a date.

    ==========
    You can also do this manually. After the import:

    1) Highlight the column of dates
    2) Select Data > Text To Columns > Delimited > Next > Next
    3) Select Column Data Format > Date: YMD > Finish
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    09-28-2009
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    3

    Smile Re: Coverting numbers to date format

    Thank you everyone!

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Coverting numbers to date format

    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated)

+ 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