+ Reply to Thread
Results 1 to 8 of 8

How to separate date and time?

  1. #1
    Forum Contributor
    Join Date
    06-20-2016
    Location
    Los Angeles/Thailand
    MS-Off Ver
    2016
    Posts
    250

    How to separate date and time?

    Hello, does anyone know how to separate Date and time? I have a table that comes with a cell that has date and time together. I would like to separate them with some kind of "=()" code.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,597

    Re: How to separate date and time?

    Simple!

    In B2:

    =A2 (column formatting: short date)

    In C2:

    =A2 (column formatting: time)
    Attached Files Attached Files
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    06-20-2016
    Location
    Los Angeles/Thailand
    MS-Off Ver
    2016
    Posts
    250

    Re: How to separate date and time?

    It works on the table but it does not work in the pivot table. It keeps coming back as date. Is there a = code that I can do it with out formatting the cell?
    Attached Images Attached Images

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,597

    Re: How to separate date and time?

    OK, so you never mentioned a pivot table, nor is there one in your sample workbook! I am not psychic ...

    Try attaching a properly representative sample workbook - give us a fighting chance.
    Last edited by AliGW; 10-20-2019 at 04:40 AM.

  5. #5
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: How to separate date and time?

    Dates are always whole numbers and times are the decimalparts of the datenumber

    So you can use

    In B2: =INT(A2) For the date

    In C2: =MOD(A2,1) For the time

    You still need to format the cells as date onky for col B and time only for col c but due to the formulas the pivottable no should interpret the colums formats correctly and show as date and time respectively.

    Then again it is also posibble to format a pivottable manualy to show the correct date or time format.
    Last edited by Roel Jongman; 10-20-2019 at 05:53 AM.

  6. #6
    Forum Contributor
    Join Date
    06-20-2016
    Location
    Los Angeles/Thailand
    MS-Off Ver
    2016
    Posts
    250

    Re: How to separate date and time?

    It worked. Thanks a lot!
    Last edited by AliGW; 10-20-2019 at 12:02 PM. Reason: Please don't quote unnecessarily!

  7. #7
    Forum Contributor
    Join Date
    06-20-2016
    Location
    Los Angeles/Thailand
    MS-Off Ver
    2016
    Posts
    250

    Re: How to separate date and time?

    Quote Originally Posted by AliGW View Post
    OK, so you never mentioned a pivot table, ...
    Thank you for trying. If you want I can upload the workbook how it worked. In Mac OS pivot table automatically separates the date and time, but on my windows excel version it does not. I'm assuming it has something to do with pay per month Office excel which usually has many updates.
    Last edited by AliGW; 10-20-2019 at 12:03 PM. Reason: Please don't quote unnecessarily!

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,597

    Re: How to separate date and time?

    It won't have anything at all to do with the Office 365 subscription and its updates.

    If you'd like to upload the workbook, one of us can take a look.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How do I separate the date and time in this column?
    By samvince in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-02-2019, 06:18 AM
  2. Parse a date+time field into separate date and time cells
    By meowmeow22 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-31-2019, 10:37 AM
  3. Replies: 7
    Last Post: 06-19-2017, 06:10 PM
  4. Replies: 2
    Last Post: 03-24-2016, 11:49 PM
  5. How to separate given date and time
    By srinivasd in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-13-2015, 12:31 AM
  6. Need to separate date/time from a single cell and create a date/time chart
    By slicksilver79 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 06-19-2014, 09:48 PM
  7. How to separate date and time into different cells
    By MDNYC in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-30-2013, 12:10 PM

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