Show time over 24 hours, 60 minutes, 60 seconds in Excel

The article shows a few tips to calculate and display times that are greater than 24 hours, 60 minutes, 60 seconds.

When subtracting or adding time in Excel, you may sometimes want to display the results as the total number of hours, minutes or seconds. The task is a lot easier than it may sound, and you will know the solution in a moment.

How to display time over 24 hours, 60 minutes, 60 seconds

To show a time interval of more than 24 hours, 60 minutes, or 60 seconds, apply a custom time format where a corresponding time unit code is enclosed in square brackets, like [h], [m], or [s]. The detailed steps follow below:

  1. Select the cell(s) you want to format.
  2. Right click the selected cells and then click Format Cells, or press Ctrl + 1. This will open the Format Cells dialog box.
  3. On the Number tab, under Category, select Custom, and type one of the following time formats in the Type box:
    • Over 24 hours: [h]:mm:ss or [h]:mm
    • Over 60 minutes: [m]:ss
    • Over 60 seconds: [s]

The following screenshot shows the "over 24 hours" custom time format in action: Display a time interval over 24 hours

Below are a few other custom formats that can be used to display time intervals exceeding the length of the standard time units.

Description Format code
Total hours [h]
Hours & minutes [h]:mm
Hours, minutes, seconds [h]:mm:ss
Total minutes [m]
Minutes & seconds [m]:ss
Total seconds [s]

Applied to our sample data (Total time 50:40 in the screenshot above), these custom time formats will produce the following results:

A B C
1 Description Displayed time Format
2 Hours 50 [h]
3 Hours & minutes 50:40 [h]:mm
4 Hours, minutes, seconds 50:40:30 [h]:mm:ss
5 Minutes 3040 [m]
6 Minutes & seconds 3040:30 [m]:ss
7 Seconds 182430 [s]

To make the displayed times more meaningful to your users, you can supplement the time unites with the corresponding words, for example:

A B C
1 Description Displayed time Format
2 Hours & minutes 50 hours and 40 minutes [h] "hours and" mm "minutes"
3 Hours, minutes, seconds 50 h. 40 m. 30 s. [h] "h." mm "m." ss "s."
4 Minutes 3040 minutes [m] "minutes"
5 Minutes & seconds 3040 minutes and 30 seconds [m] "minutes and" ss "seconds"
6 Seconds 182430 seconds [s] "seconds"

Note. Although the above times look like text strings, they are still numeric values, since Excel number formats change only the visual representation but not the underlying values. So, you are free to add and subtract the formatted times as usual, reference them in your formulas and use in other calculations.

Now that you know the general technique to display times greater than 24 hours in Excel, let me show you a couple more formulas suited for specific situations.

Calculate time difference in hours, minutes, or seconds

To calculate the difference between two times in a specific time unit, use one of the following formulas.

Time difference in hours

To calculate hours between the start time and end time as a decimal number, use this formula:

(End time - Start time) * 24

To get the number of complete hours, utilize the INT function to round the decimal down to the nearest integer:

=INT((B2-A2) * 24)

Time difference in minutes

To calculate minutes between two times, subtract the start time from the end time, and then multiply the difference by 1440, which is the number of minutes in one day (24 hours*60 minutes).

(End time - Start time) * 1440

Time difference in seconds

To get the number of seconds between two times, multiply the time difference by 86400, which is the number of seconds in one day (24 hours*60 minutes*60 seconds).

(End time - Start time) * 86400

Assuming the start time in A3 and end time in B3, the formulas go as follows:

Hours as a decimal number: =(B3-A3)*24

Complete hours: =INT((B3-A3)*24)

Minutes: =(B3-A3)*1440

Seconds: =(B3-A3)*86400

The following screenshot shows the results: Calculating time difference in hours, minutes, or seconds

Notes:

  • For correct results, the formula cells should be formatted as General.
  • If the end time is greater than the start time, the time difference is displayed as a negative number, like in row 5 in the screenshot above.

How to add / subtract more than 24 hours, 60 minutes, 60 seconds

To add a desired time interval to a given time, divide the number of hours, minutes, or seconds you want to add by the number of the corresponding unit in a day (24 hours, 1440 minutes, or 86400 seconds), and then add the quotient to the start time.

Add over 24 hours:

Start time + (N/24)

Add over 60 minutes:

Start time + (N/1440)

Add over 60 seconds:

Start time + (N/86400)

Where N is the number of hours, minutes, or seconds you want to add.

Here're a few real-life formula examples:

To add 45 hours to the start time in cell A2:

=A2+(45/24)

To add 100 minutes to the start time in A2:

=A2+(100/1440)

To add 200 seconds to the start time in A2:

=A2+(200/86400)

Or, you can input the times to add in separate cells and reference those cells in your formulas like shown in the screenshot below: Add over than 24 hours, 60 minutes, 60 seconds

To subtract times in Excel, use similar formulas but with the minus sign instead of plus:

Subtract over 24 hours:

Start time - (N/24)

Subtract over 60 minutes:

Start time - (N/1440)

Subtract over 60 seconds:

Start time - (N/86400)

The following screenshot shows the results: Subtract over than 24 hours, 60 minutes, 60 seconds

Notes:

  • If a calculated time displays as a decimal number, apply a custom date/time format to the formula cells.
  • If after applying custom formatting a cell displays #####, most likely the cell is not wide enough to display the date time value. To fix this, expand the column width either by double-clicking or dragging the right boundary of the column.

This is how you can display, add and subtract lengthy time intervals in Excel. I thank you for reading and hope to see you on our blog next week!

Latest comments

  1. How do I get an IF formula to bank any labor hours that do not total 30 hours? I’m using IF=((G2>30),(G2-30)). However if the employee has less than 30 hours to bank the formula is not working. So I am using a different formula IF((G3<30),G3) for those employees. I need one big formula to do both scenarios since labor hours total varies per pay period.

    1. Hello Lorena!
      You will be able to get the correct number of working hours per condition if you study the IF function manuals carefully.
      If I understand your task correctly, try the following formula:

      =IF((G2>30),G2-30, G3)

  2. alrighty, I have a table with at least 75 rows with time stamps ex; 11;29;48 AM. I am trying to figure out how to get excel to count exactly how many run from 5;30 am - 5;30 pm and vis versa

  3. I am trying to calculate how many hours difference from 4pm day 1 to 9am the next day
    This needs to exclude the hours from 5pm to 8am

  4. I have a sheet with about 500 rows containing in one column values such as "32 minutes" or "6 hours 44 minutes". I need to calculate the sum of these values.
    Please help

    1. Hi! Text that does not have a common pattern cannot be converted to time using a single formula. You need 2 different formulas for your data.

  5. Hello,
    I wish to create a table which contains: A cell with minutes (e.g. 45min) to be added to another cell containing the time (e.g. 10:30) and in another cell it will calculate the answer as new time being the 45min passed after 10:30 (e.g. 11:15), is this possible?
    Thanks and regards
    Godwin

  6. I want to do conditional formatting on cells with time. I have a column that advances time by one minute using this formula =B22+(1/1440). I have another cell that calculates 3 hours from another time entered elsewhere, so that E5 is manually entered as a time by the user, and G5 is =E5+(3/24) to advance G5 3 hours. I want my B column to highlight the minute that matches G5. I can make it work, but for some minutes it is not true. I have compared the values and it seems the code for the time is off for calculating the minute sometimes. For example 0.17430555555555500000 0.174305555555556000 FALSE,
    both represent 04:11 in B137 and G5 respectively, but as these are not equal the conditional formatting will not apply.
    I have tried advancing time in G5 using +(180/1440) to see if it would improve accuracy and will still have a problem with some cells formatting. I have changed 180 to various lengths of time to see the formatting occur and will notice that it fails at some point in time. Is there a way to overcome or fix this time code discrepancy that seems to be causing the formatting to fail?

    1. Hi! Compare hours and minutes in the conditional formatting formula instead of decimals. Extract the desired data from the number using the HOUR and MINUTE functions.

      =AND(HOUR(B22)=HOUR($F$5),MINUTE(B22)=MINUTE($F$5))

      This should solve your task.

  7. Hi, I have cell G6 with this formula
    =HOUR(F6-E6)&"hours,"&MINUTE(F6-E6)&"minutes,"&SECOND(F6-E6)&"seconds"

    and cell P6 with this formula
    =HOUR((O6-N6)+(M6-L6)+(K6-J6)+(I6-H6))&"hours,"&MINUTE((O6-N6)+(M6-L6)+(K6-J6)+(I6-H6))&"minutes,"&SECOND((O6-N6)+(M6-L6)+(K6-J6)+(I6-H6))&"seconds"

    I want to subtract G6-P6 to get remaining hours but I get #VALUE! How do I solve this?

    For context cell in G6 formula is for wake up time minus sleep time , that displayed date & time eg 2/3/23 1:30 AM.

    While cell P6 total time of deep sleep time happens during sleep. (Deep sleep happens multiple times, in this case 4 times, hence the lengthy formula)

    How do I make the formula for total sleep minus deep sleep? That will display hours, minutes & seconds?

    I’ve tried TIME(G6,G6,G6) - TIME(P6,P6,P6) but I get #VALUE!

  8. I have been trying and trying to subtract a time in a 24 hour period.

    I need to subtract 7:14 from 24:00.

    Steve

  9. Hi everybody
    I have an excel template to calculate enzyme activity. This is the formula they used to convert enzyme activity measured activity in 30 minutes to activity per hour:
    =C51*2*Scale/concentration/dilution factor/A/24

    where A is the difference between the starting time and the measuring time
    1:31:44 PM-1:00:30 PM=00:31 (A=0:31 minutes)

    my question is related to this part /A/24

    why they divided the values by 24?
    I would be very thankfull if someone can help me.
    Bests

      1. A is 30 minutes

  10. Hi All,

    At the excel sheet, I want to change time format, for example, from 1:00PM of 12 hour format in to 13:00:00 of 24 hour format. I tried all the options at "format cells" but i could not succeeded. Can any body remind me if i missed something or help me please?

    Thanks!

  11. Hi, can please assist if i got the below info
    07:27alt enter18:04 in one excel
    how can i separate it in to excel,
    i wish to separate it out to two excel in time format so i can subtract it to calculate the working time and calculate any OT allowance

  12. Total activation duration (minutes)

    18504:06

    which formula to do use to convert this unto hours, minutes & seconds ?

  13. i'd like to start a count down of hours left - 3000 hours minus what cell B2 shows. Can you please share how to do this?
    much appreciated.

  14. I have a report that gives seconds and I need an excel formula that will display that as HH:MM:SS - Anything over 86400 displays improper number of hours. Thanks

    1. Go it - Divide by 86400 and format as {h}:MM:SS -

  15. Hi, I've date-time format like 15-03-2020 01:50, Now I want to display the time as 13:50 and so on.. the problem is these times are autogenerated and don't have AM or PM. How I need to accomplish.

  16. Is there a formula to take total hours worked in a year but only change the format for minutes to a decimal?
    Ex: 574:40 ([h]:mm cell format
    convert to 574.67 hours
    * I want to keep the hours the same but convert the number after the : to a decimal
    Thanks

  17. I am looking to identify the total minutes for the following that has been split into days, hours, minutes, seconds: in the format of 01:04:56:05
    01 - in theory 24 hours
    04 - 4 hours
    56 - minutes
    05 - seconds
    I should be able to see: 1736 minutes

    1. Hello!
      To convert hours into minutes, you must first multiply the specified time by 60 (the number of minutes in one hour), then by 24 (the number of hours in one day). In other words, we need to multiply time by 1440.
      I believe the following formula will help you solve your task:

      =TIMEVALUE(MID(A1,4,20))*1440+60*24*(--LEFT(A1,2))

      Hope this is what you need.

  18. Hi excel specialist
    How can I change from excel format from 24-00 to 24.00. what is the formula
    Pls. advise thanks in advance hope to hear from anyone.

  19. Setting up a time card, I have 9 columns, 3 sets of IN time and OUT time. I can get columns to add up using a 24 hour format when it's a low vs a high hour such as IN:0600 / OUT:1600 for a total of 10 hours. However, what I can't figure out is how to formulate In:2000 / OUT:0600 for a total of 10 hours as the amount of time worked was 10 hours.

    I know out how to get it to auto sum hours worked when I format the cell (mm/dd/yyyy h:mm) but that over populates the time card and makes it a lot harder to read. Is there a way to auto calculate the total hours worked using (h:mm) and auto sum the 3 column sets into a single total hours worked regardless of what day and time they clocked in?

    My crews work 24 hour rotating shifts logging between 8 to 14 hours at a time. They also check out between the start and end of the shift and have to clock back in.

    For Example; IN-19:00 (Begin Shift) OUT-24:00 (30 Min Meal) / IN-00-30 OUT-0330 (30 Min Rest) / IN-0400 OUT-0600 (Time to go Home) Total time worked: 10 Hours

    I want to set up a time card they can just put in the time they clock in and the time they clock out to simplify their lives. It'll also help keep from displaying unnecessary data for our finance clerk and speed the processing of payroll up.

    1. Hello Rick!
      If the end time is longer than the start time, then you need to add 1 day to their difference

      =IF(A1 > A2,A2-A1+1,A2-A1)

      If you need the number of hours to be more than 24, use the custom format [h]:mm:ss.
      I hope this will help, otherwise please do not hesitate to contact me anytime.

  20. Hi,
    I have a data dump from a scheduling system that displays the time in excel as follows:
    1.00:48:34 - I am reading this as 1 day, 48 minutes, 34 seconds.
    1.10:19:09 - 1 day, 10 hours, 19 minutes and 9 seconds.
    When I try to add these cells in Excel, I get nothing. What time format can I convert these to and/or what formula could I use?

    1. Hello Alan!
      If I got you right, the formula below will help you with your task:

      =LEFT(A1,FIND(".",A1,1)-1)+TIMEVALUE(RIGHT(A1,8))

      Please go to Format Cells, choose Number -> Custom Format and set

      d"d."h"h."mm"m."ss"s."

      I hope this will help, otherwise please do not hesitate to contact me anytime.

Post a comment



Thanks for your comment! Please note that all comments are pre-moderated, and off-topic ones may be deleted.
For faster help, please keep your question clear and concise. While we can't guarantee a reply to every question, we'll do our best to respond :)