+ Reply to Thread
Results 1 to 5 of 5

Excel 2008 : Date format

  1. #1
    Registered User
    Join Date
    02-09-2011
    Location
    US
    MS-Off Ver
    Excel Mac 2011
    Posts
    31

    Date format

    Hi all,
    I have inherited a data set with some important historical data that I need to work with. The issue I am having is that the date and time is saved as one cell with just the number 200810151200 for 2008 october 15 1200. It is a huge data set with values generated each 15 minutes all year. I would like to clean this up into a column with the date (formatted day/month/year) and a second column with the time. I have tried formatting the cell as a date with various date formats to no avail. is there any quick way to extract the values for columns or do I have to go through and type everything out?

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Date format

    Hi,

    Try this:

    For the date: =DATE(LEFT(A1,4),MID(A1,5,2),MID(A1,7,2))
    For the time: =TIME(MID(A1,9,2),RIGHT(A1,2),0)

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    02-09-2011
    Location
    US
    MS-Off Ver
    Excel Mac 2011
    Posts
    31

    Re: Date format

    Works perfectly. Thank you for the prompt and excellent response.

  4. #4
    Registered User
    Join Date
    02-09-2011
    Location
    US
    MS-Off Ver
    Excel Mac 2011
    Posts
    31

    Re: Date format

    Similar question. Now the date is save as 12/1/2007 12:00:00 AM formatted as date and time cell. If i change the format to general number it is 37955. What is the best way to separate the column into one column for date and one for time?

  5. #5
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Date format

    If A1 contains a serial date/time value then:

    =INT(A1) will give you the date
    =MOD(A1,1) will give you the time

    Format the cells as appropriate.

    Dom
    Last edited by Domski; 04-11-2011 at 09:12 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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