+ Reply to Thread
Results 1 to 5 of 5

How to separate date and time into different cells

  1. #1
    Registered User
    Join Date
    05-30-2013
    Location
    New York
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    2

    How to separate date and time into different cells

    I have date and time in column A in the following format:
    31-Dec-2012 06:23:00 PM PST

    I'd like to separate date into one column and time into another. I tried the formula =INT(A1) but I get a #VALUE error.
    Can someone help please?

    I'm trying to calculate average daily transactions. Thus, once I format column A into date only, I could do a COUNT formula to calculate how many transactions took place on each day. Unless one of you has a better method.

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

    Re: How to separate date and time into different cells

    Your dates are in text format, so you need to manipulate them a bit further. For the dates, try this:

    =VALUE(LEFT(A1,11))

    and for the times you can use this:

    =MID(A1,13,8)+IF(MID(A1,22,2)="PM",0.5,0)

    Format the cells appropriately.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    05-30-2013
    Location
    New York
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    2

    Re: How to separate date and time into different cells

    Thanks, Pete!
    This is great, but I think I'm getting rusty. I didn't need the time stamp to sort daily transactions. So I just did a Find and Replce using "space*" and replace with blank. That got rid of the time stamps and left me with only the date info that I needed. But I'll keep your solution in mind for future reference!

  4. #4
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: How to separate date and time into different cells

    Hi MDNYC

    Assuming your data is in column A and is the same format as your data in post #1.

    B1: =--LEFT(A1,11) & format as required
    C1: =--MID(A1,13,11) & format as required
    Regards Kevin


    Merged Cells (They are the work of the devil!!!)

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

    Re: How to separate date and time into different cells

    Well, you title asked about separating dates and times, but glad to hear you reached a solution on your own.

    Pete

+ 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