+ Reply to Thread
Results 1 to 11 of 11

Convert Hours to Seconds

  1. #1
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Convert Hours to Seconds

    Hi Experts,

    How do i convert time in hours (a1) to seconds (b1) if the A1 is formatted as 00\:00\:00?

    A1 is 01:30:05 = seconds (?)


    Cell is custom formatted to 00\:00\:00

    Thank you in advance
    If I've helped U pls click on d *Add Reputation

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Convert Hours to Seconds

    Use this formula in B1:

    =A1*24*60*60

    or just

    =A1*86400

    The formatting of A1 doesn't matter as long as it is a time value. B1 should be formatted as General (not a time format).
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: Convert Hours to Seconds

    thank you Jeff. Unfortunately its not working..

    A1 is formatted to 00\:00\:00 so i could just enter 13005 and it will show as 01:30:05 in A1.

    If I use the formula you provided the answer is not 5405.

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

    Re: Convert Hours to Seconds

    that is because you are not entering times but do a formating trick on a regular number..

    with numbers like that try this formula

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: Convert Hours to Seconds

    Thank you Roel. It does the trick; however, it does not work if i only input minutes or just seconds..

    need to the formula to calculate if only minutes were entered or even seconds.

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Convert Hours to Seconds

    What is the need you are meeting by entering a string of digits into A1 instead of an actual time?

  7. #7
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: Convert Hours to Seconds

    for convenience Jeff. the cell is formatted to 00\:00\:00 so i could just enter 13005 and it will show 01:30:05 (1 hour, 30 minutes and 5 seconds)

    i have this formula =INT(A1/100)+(A1-100*INT(A1/100))/60)/60/24)*86400) which does the trick if the format is limited to just 00\:00 but need to extend it to 00\:00\:00 to accommodate seconds if any.

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

    Re: Convert Hours to Seconds

    ok moving forward on your formula above.
    try this

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    you might need to change the semi colons in the formmula with comma depending on regional setting for list separator

  9. #9
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    485

    Re: Convert Hours to Seconds

    Just use

    =TEXT(A1,"00\:00\:00")*86400

  10. #10
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Convert Hours to Seconds

    ignore this post. I just notice you've 2007 which doesn't support PowerQuery

    one way, use PowerQuery
    Please Login or Register  to view this content.
    Last edited by sandy666; 06-18-2018 at 01:09 PM.

  11. #11
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: Convert Hours to Seconds

    Thank you Roel. Works like a charm!!!

+ 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] Convert seconds to years, months, days, hours, minutes snd seconds
    By Tresfjording in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-14-2022, 12:55 AM
  2. convert seconds to decimal minutes and hours
    By stoey in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-15-2013, 02:10 PM
  3. [SOLVED] Convert seconds to 1 day 3 hours 25 minutes.
    By bandera in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-28-2013, 10:50 PM
  4. convert from seconds to form hours: minutes: seconds?
    By nguyen_han in forum Excel General
    Replies: 2
    Last Post: 10-13-2011, 06:56 AM
  5. Convert Hours, Minues and Seconds To Time Decimal
    By Nett in forum Excel General
    Replies: 6
    Last Post: 08-07-2009, 05:22 AM
  6. Convert Decimal - Days, Hours and Seconds
    By aidan80 in forum Excel General
    Replies: 4
    Last Post: 05-11-2009, 05:15 PM
  7. Convert Hours to Minutes and Seconds
    By Jenna11 in forum Excel General
    Replies: 10
    Last Post: 01-08-2007, 09:04 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