+ Reply to Thread
Results 1 to 8 of 8

Strip time from date

  1. #1
    Registered User
    Join Date
    10-22-2013
    Location
    Utrecht, The Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    29

    Strip time from date

    Cells containing dates I formated as d-m-yyyy and the cells are showing dates like "19-2-2014". However if I want to use the dates in a pivot table and want to select a range I also see the time value forcing me to select too many entries. In the pivot the date showes like this "19-2-2014 15:51:09"

    How can I strip the time (and if possible the day) from the date field? Can this be done with a formula or do I need something in VBA?
    Cheers, Armand0

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Strip time from date

    You can use the INT function to get just the date..

    =INT(A1)


    And to get the time only
    =MOD(A1,1)

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Strip time from date

    Try using =INT(a1) format as date

    Date is just a number that represents how many days have passed since 1/1/1900, and time is a decimal value. 06:00 am is 0.25, 12 noon is 0.5 etc
    Last edited by FDibbins; 02-27-2014 at 12:38 PM.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Strip time from date

    Can't you group by day?
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    01-06-2014
    Location
    Columbus, IN
    MS-Off Ver
    2013/O365
    Posts
    41

    Re: Strip time from date

    well, crap. that beats what I've been doing:
    =DATEVALUE(MONTH(A4)&"-"&DAY(A4)&"-"&YEAR(A4))
    It works but obviously not as clean/quick lol
    -Russell

  6. #6
    Registered User
    Join Date
    10-22-2013
    Location
    Utrecht, The Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: Strip time from date

    Quote Originally Posted by Jonmo1 View Post
    You can use the INT function to get just the date..

    =INT(A1)


    And to get the time only
    =MOD(A1,1)
    Thanx for this explanation, this works for me.
    Last edited by Armand0; 03-03-2014 at 04:08 AM.

  7. #7
    Registered User
    Join Date
    10-22-2013
    Location
    Utrecht, The Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: Strip time from date

    Quote Originally Posted by FDibbins View Post
    Try using =INT(a1) format as date

    Date is just a number that represents how many days have passed since 1/1/1900, and time is a decimal value. 06:00 am is 0.25, 12 noon is 0.5 etc
    Thanx for the explanation, this works for me.

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Strip time from date

    Happy to help and thanks for the feedback

+ 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. Replies: 3
    Last Post: 12-19-2013, 06:49 AM
  2. Strip date and keep time from row of cells
    By Christians in forum Excel General
    Replies: 2
    Last Post: 04-13-2011, 02:50 PM
  3. Strip Date From Text String
    By jaslake in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-19-2010, 10:34 PM
  4. [SOLVED] How can you strip the time of day out of a date field
    By Ron in forum Excel General
    Replies: 3
    Last Post: 04-19-2006, 02:30 PM
  5. [SOLVED] Strip Out Time
    By HeartSA in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 10-13-2005, 04:05 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