+ Reply to Thread
Results 1 to 2 of 2

Remove milliseconds from timestamp

  1. #1
    Registered User
    Join Date
    10-22-2011
    Location
    New York, USA
    MS-Off Ver
    Excel 2003
    Posts
    1

    Remove milliseconds from timestamp

    I have cells that contain a time and date in decimal form. Specifically:
    40838.44059
    40838.44058

    When I format the cell as date and time, it shows:

    10/22/11 10:34
    10/22/11 10:34

    I believe that there are milliseconds attached to the time, even though I am not showing them. I need to filter my data such that there are no duplicates, but this cannot be done since even the timestamps in decimal form are not equivalent. When Excel does the comparison, it looks at the decimal value, not the formatted value and thus they are not the same.

    Is there an easy way that I can modify the timestamp so that it does not include any milliseconds? What i've done so far is extract the hour and minute from the time stamp and then sort like that. But doing that then requires me to have several additional cells and do some =text parameters with lots of ':'s and '/'s to try and put it all together so that it looks like the above format. I would ultimately like to somehow remove the seconds so that the date and timestamp only have hh:mm and return it to a decimal format so I can format the cells as date/time. Any suggestions would be helpful.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Remove milliseconds from timestamp

    Try = INT(A1*24*60)/(24*60)
    Is that acceptable?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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