+ Reply to Thread
Results 1 to 6 of 6

Converting timestamp to correct days/hours for sorting

  1. #1
    Registered User
    Join Date
    05-26-2010
    Location
    Oklahoma
    MS-Off Ver
    Excel 2007
    Posts
    6

    Converting timestamp to correct days/hours for sorting

    In my excel file, I have columns of times that has always listed the data in a second format and nothing has ever been over 1 day until now. I was converting the cell to [h]:mm:ss;@ but if the seconds is equal to one day it lists the time as 0:00:00. I would like to be able to list the total hours:minutes:seconds so if it was 1 day 1 hour and 15 minutes and 22 seconds it would display as 25:01:15:22. Should I just store this is a text field, or is there a different cell format that I just dont see to show things in the complete hour format like I showed above?

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

    Re: Converting timestamp to correct days/hours for sorting

    The custom format you specify would list 1 as 24:00:00 not 0:00:00

    I think we need to see a sample of the values.

  3. #3
    Registered User
    Join Date
    05-26-2010
    Location
    Oklahoma
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Converting timestamp to correct days/hours for sorting

    Here is the VBA code I am using.

    Please Login or Register  to view this content.
    Last edited by redbrad0; 08-10-2010 at 06:33 PM.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Converting timestamp to correct days/hours for sorting

    Please take a few minutes to read the forum rules, and then change your QUOTE tags to CODE tags.

    Thanks.
    Last edited by shg; 08-10-2010 at 06:30 PM.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    05-26-2010
    Location
    Oklahoma
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Converting timestamp to correct days/hours for sorting

    I changed it to code tags, and im sure this will make someone not respond to giving me help but that is so stupid to reply saying to change the tags. I WOULD have used CODE tags instead of QUOTE tags but by default the CODE tags are not being displayed (on quick reply). If the forum wants us to use CODE tags when we place CODE, than they should make the CODE tags actually visible instead of having to click GO ADVANCED.

    The QUOTE tags format the code to display it in a way that anyone can see the code, so instead of just posting asking me to change my post, why not offer help and then say "By the way, if you look at the forum rules, we would rather the code by wrapped by CODE tags. Please edit your post and try and use CODE tags anytime you paste in code."

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Converting timestamp to correct days/hours for sorting

    Ignoring the rant,
    Please Login or Register  to view this content.
    ... assuming tmpdata is time in minutes.
    Last edited by shg; 08-10-2010 at 06:43 PM.

+ 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