Apr
12

How to add & subtract time in Excel to show over 24 hours, 60 minutes, 60 seconds

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 sell(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:

  1. For correct results, the formula cells should be formatted as General.
  2. 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:

  1. If a calculated time displays as a decimal number, apply a custom date/time format to the formula cells.
  2. 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!

You may also be interested in:

9 Responses to "How to add & subtract time in Excel to show over 24 hours, 60 minutes, 60 seconds"

  1. larry says:

    I believe you have an error in the section "How to add / subtract more than 24 hours, 60 minutes, 60 seconds".
    "Here're a few real-life formula examples:
    To add 45 hours to the start time in cell A2:
    =A2+(30/24)"

    the formula should be =A2 + (45/24)

    the other info was helpful

  2. Imran Masud says:

    Thanks, Svetlana.

  3. rohan says:

    Hi Svetlana, This is very useful and very informative. I have some doubt if have time 12:30 and i apply formula as A2+(2/25) then it decreases the time by 5 Minutes and gives 14:25 time and if apply A2+(2/23) then it increases the time by 5 Minutes and gives 14:35. Could please give me clarity on this how does it calculate?

    Thanks, Svetlana again!!

    • Hi Rohan,

      I don't know the reasoning behind your calculations, but the results are correct. As you probably know, in internal Excel system, times are stored as decimal fractions, e.g. 00:00:00 is stored as 0.0 and 23:59:59 is stored as 0.99999. So, in terms of times, 2/25 (0.08) is 1:55, when added to 12:30, it gives you 14:25.

      For more information, please see Excel time format.

  4. rohan says:

    Thanks Svetlana

  5. Indra says:

    Hi there!

    How should i add running clock in excel?

  6. Isaiah says:

    Thank you so very much. Much appreciated

Post a comment



Unfortunately, due to the volume of comments received we cannot guarantee that we will be able to give you a timely response. When posting a question, please be very clear and concise. We thank you for understanding!
Excel add-ins and Outlook tools - Ablebits.com
Ultimate Suite for Excel Professionals
 
 
60+ professional tools for Excel 2016-2007 to do your daily work
Incredible product, even better tech support…AbleBits totally delivers!
Deborah Bryant
Anyone who works with Excel is sure to find their work made easier
Jackie Lee
The best spent money on software I've ever spent!
Patrick Raugh
Ablebits is a fantastic product - easy to use and so efficient.
Debra Celmer
Excel is at its best now
Annie C.
I don't know how to thank you enough for your Excel add-ins
Jennifer Morningstar
Anybody who experiences it, is bound to love it!
Kumar Nepa
AbleBits suite has really helped me when I was in a crunch!
Nelda Fink
I have enjoyed every bit of it and time am using it
Christian Onyekachi Nwosu
It's the best $100 we've ever spent!
Mike Cavanagh
I love the program, and I can't imagine using Excel without it!
Robert Madsen
One word… WOW!
Dave Brown
Love the products!
David Johnston
It is like having an expert at my shoulder helping me…
Linda Shakespeare
Your software really helps make my job easier
Jeannie C.
Thanks for a terrific product that is worth every single cent!
Dianne Young
I love your product
Brad Gibson
Awesome!!!
Sheila Blanchard