+ Reply to Thread
Results 1 to 4 of 4

Extract time and date from 1 cell

  1. #1
    Registered User
    Join Date
    05-11-2009
    Location
    Belfast
    MS-Off Ver
    Excel 2010
    Posts
    65

    Extract time and date from 1 cell

    / have a column of cells which has date and time in one cell e.g.

    07/11/2009 08:07:22 (I have attached a spreadsheet with some examples)

    I can get the information extracted if i use: =TEXT(A10,"HH:mm") for the time and change HH:mm to MMM-DD for the date

    However, when I run a Pivot it sorts the date alphabetically rather than by date.

    Anyone know how I can get around this?

  2. #2
    Registered User
    Join Date
    09-23-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Extract time and date from 1 cell

    Can you not just copy the cell into two cells then just change the formatting of one of the cells to mm/dd/yyyy and the other to hh:mm or however you want it formatted

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

    Re: Extract time and date from 1 cell

    Time is Decimal, Dates are Integers... eg

    =INT(A10) will give you just date

    =MOD(A10,1) will give you just time

    In Pivots you can Group by various Date Time periods, without knowing your end goal it's hard to know if you need to split the datetime values in the first instance.

    For more info. on Grouping Date related fields in Pivots see: http://www.contextures.com/xlPivot07.html

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Extract time and date from 1 cell

    Quote Originally Posted by jaywizz View Post
    / have a column of cells which has date and time in one cell e.g.

    07/11/2009 08:07:22 (I have attached a spreadsheet with some examples)

    I can get the information extracted if i use: =TEXT(A10,"HH:mm") for the time and change HH:mm to MMM-DD for the date

    However, when I run a Pivot it sorts the date alphabetically rather than by date.

    Anyone know how I can get around this?

    No sheet attached. To extract date use =int(a10) for time =a10-int(a10) - Format as needed

+ 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