+ Reply to Thread
Results 1 to 6 of 6

Converting time to seconds? [dd:hh:mm:ss}

Hybrid View

  1. #1
    Registered User
    Join Date
    10-04-2013
    Location
    Salt Lake City
    MS-Off Ver
    2010
    Posts
    84

    Converting time to seconds? [dd:hh:mm:ss}

    Happy Tuesday......

    (I searched, and didn’t find what I am looking for, so apologies if this has been addressed already)

    I’m a data analyst – and I will always feel novice at excel haha.

    Here’s my question, I’m exporting data of total Talk times per month, the data comes in the following format “dd:hh:mm:ss” I need to convert this to seconds. I know that =A1*24*60*60 normally works, and it does, only if the dd=00, example if the time is 00:08:24:35 it works, but if the time is 01:08:24:35 it does not work.. and I am stuck! Any assistance would be awesome!


    Cheers!

  2. #2
    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
    53,049

    Re: Converting time to seconds? [dd:hh:mm:ss}

    Hi and welcome to the forum

    It worked fine for me...
    01 8:24:35 =A1*24*60*60 = 116675.00

    Perhaps your data is not really numeric, but text that looks like a number? text with =isnumber()
    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

  3. #3
    Registered User
    Join Date
    10-04-2013
    Location
    Salt Lake City
    MS-Off Ver
    2010
    Posts
    84

    Re: Converting time to seconds? [dd:hh:mm:ss}

    Thanks for the quick reply (Can I attach a workbook?)

    =isnumber() = FALSE on the date I am looking at - and the formet can be either "time" or "general" and I I get the same results.


    It works if the there's no "day" but when its 1:20:43:17 [d:hh:mm:ss] I get the #VALUE! everytime! ugh.

  4. #4
    Registered User
    Join Date
    10-04-2013
    Location
    Salt Lake City
    MS-Off Ver
    2010
    Posts
    84

    Re: Converting time to seconds? [dd:hh:mm:ss}

    It has to be the way the data is forematted - weird, the cells that the time is under 1 day, the cell is a number, however, the cells with 1:24:24:24 are static text. not actullay a number

  5. #5
    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
    53,049

    Re: Converting time to seconds? [dd:hh:mm:ss}

    Sorry for the delay in replying

    FALSE indicates that your cells contain text, not values/numbers, so no amount of formatting will change them - you need to do that through a formula.

    Try this, it 1st tests for a valid number, and then uses that, else it converts the "day" text to a real number.
    =IF(ISNUMBER(A4),A4,MID(A4,SEARCH(":",A4,1)+1,99)+LEFT(A4,SEARCH(":",A4,1)-1))
    format custom d hh:mm:ss

    On a side note, in case you didnt know, excel treats time as a decimal of 1 (day). So 06:00 AM is actually 0.25 and 18:00 PM is really 0.75

  6. #6
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Converting time to seconds? [dd:hh:mm:ss}

    welcome to the forum, BenCrockett. another alternative if the data is always in the form of dd:hh:mm:ss
    =LEFT(A1,2)+RIGHT(A1,8)
    format cells to desired format of dd:hh:mm:ss

    or if there's possibility it's without the days & in number format, then:
    =IF(N(A1),A1,LEFT(A1,2)+RIGHT(A1,8))

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

+ 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] Converting seconds from midnight to time of day in the HH:MM:SS format
    By luv2glyd in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-26-2013, 10:45 AM
  2. [SOLVED] Converting a Date-Time code to seconds
    By dredwolf in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-02-2012, 03:52 PM
  3. Converting time from seconds
    By ssmith911 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-31-2008, 11:43 AM
  4. Converting time format to seconds
    By rqy99g in forum Excel General
    Replies: 2
    Last Post: 05-08-2008, 01:29 PM
  5. converting time to seconds
    By Peter in forum Excel General
    Replies: 10
    Last Post: 01-18-2006, 07:25 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