How to sum and format a range of hours, minutes, or seconds in Excel
This article was previously published under Q266691
To automatically format times that when added together exceed 24 hours, 60 minutes, or 60 seconds, you can use the following custom number formats and the SUM function in Excel:
- Hours = [h]:mm:ss
- Minutes = [m]:ss
- Seconds = [ss]
In Microsoft Excel, the custom hours format is already created. However, you must create the minutes and seconds formats for each workbook that needs them.
To correctly display hour totals greater than 24, and minute and second totals greater than 60, use the following methods.
Example for Hours
To format time sums that are greater than 24 hours, follow these steps:
- Create a new worksheet and type the following values. Make sure to use a colon (:) to separate the numbers.
A1: 12:35:58 A2: 12:24:30 A3: 11:18:23
- Type the following formula into cell A4. Excel automatically formats the result correctly if you are adding hours.
Excel displays 36:18:51 as the total.
Example for Minutes and Seconds
To format minute or second sums that are greater than 60, follow these steps:
- Create a new worksheet and type the following values. Make sure to insert the leading zeros (00), and use a colon (:) to separate the numbers.
A1: 00:42:58 A2: 00:19:30 A3: 00:37:23
- Type the following formula in cell A4:
A4: =SUM(A1:A3) Excel displays 1:39:51 as the total. To display this total as minutes and seconds, or seconds only, follow these steps to create and apply the appropriate format:
After you apply the minutes format, Excel displays 99:51 as the total.
- Right-click cell A4, and then click Format Cells.
- Click the Number tab.
- In the Category list, click Custom.
- In the Type box, edit the number format codes to create the format you want.
- For the minutes format, type [m]:ss
- For the seconds format, type [ss]
- Select the formatting that you want to apply, and then click OK.
After you apply the seconds format, Excel displays 5981 as the total.
NOTE: When you edit a built-in format, Excel creates a new format but does not replace the existing format.
How to Apply the Formats to Additional Cells
After you create the custom minutes and seconds formats, follow these steps to apply them to any additional
cells in the workbook:
- Right-click the cells that you want to display the newly created format, and then click Format Cells.
- In the dialog box, click the Number tab, and then click Custom.
- In the custom list of formats, click to select the appropriate format, and then click OK.
XL2000 XL2002 XL2003 XL2007 XL2010 XL2013 format and time formatting times adding dates sum days kbhowto
Article ID: 266691 - Last Review: 10/25/2012 02:46:00 - Revision: 9.0
Microsoft Excel 2002 Standard Edition, Microsoft Excel 2000 Standard Edition, Microsoft Office Excel 2003, Microsoft Office Excel 2007, Microsoft Excel 2010, Microsoft Excel 2013