Adding Time in Excel: How to Sum Hours and Minutes
In this article
To add time in Excel, use the SUM function (e.g., =SUM(A1:A5)) and apply the [h]:mm custom number format to the result cell. This ensures that when your total exceeds 24 hours, Excel continues counting the hours rather than resetting the clock to zero.
Adding time in Excel is different from adding standard numbers because Excel treats time as a fraction of a 24-hour day. For example, 12 hours is stored as 0.5. Without the correct formatting, a total of 25 hours will appear as 1 hour because Excel "rolls over" the time every 24 hours. By following the steps below, you can accurately calculate total durations for timesheets, project logs, or event schedules.
What You'll Need
- Microsoft Excel (Desktop, Web, or Mobile version)
- A dataset of time values entered in a recognized time format (e.g., HH:MM or HH:MM:SS)
Step-by-Step
- Enter your time data: Input your hours and minutes into a column. Use a colon to separate hours from minutes (for example, type
8:30for eight hours and thirty minutes). Ensure the cells are recognized as "Time" by Excel; they will typically align to the right of the cell by default. - Select the total cell: Click on the empty cell where you want the sum of your time to appear.
- Enter the SUM formula: Type
=SUM(, then click and drag to select the range of cells containing your time values, and close the parenthesis. For example:=SUM(B2:B10). Press Enter. - Open the Format Cells menu: Right-click the cell containing the result and select Format Cells... (Note: Menu labels may vary slightly depending on your version of Excel or operating system).
- Access Custom Formatting: In the Format Cells dialog box, go to the Number tab. In the Category list on the left, select Custom.
- Apply the duration code: In the Type input box, delete whatever is currently there and type exactly:
[h]:mm. The square brackets around the "h" tell Excel to calculate total elapsed hours rather than the time of day. - Save changes: Click OK. Your total will now correctly display totals exceeding 24 hours.
Common Mistakes
- Entering time as decimals: Typing "8.5" instead of "8:30" tells Excel you mean 8.5 days, not 8.5 hours. Always use the colon (:) for time entries.
- Using the default "Time" format: Using the standard "Time" category in the Format Cells menu will cause the total to reset to 0 after 24 hours. You must use the
[h]:mmcustom format for durations. - Mixing time and text: If you type "8 hours" into a cell, Excel treats it as text and the SUM function will ignore that cell, resulting in an incorrect total. Enter only the numbers and the colon.
Tips
- Adding seconds: If your data includes seconds, use the custom format
[h]:mm:ssto ensure they are tracked and summed correctly. - Quick Formatting: You can apply the custom format to an entire column before you even enter the data to save time.
- Subtracting Time: To find the difference between two times (like a start time and end time), use a simple subtraction formula:
=End_Time - Start_Time. - Converting to Decimals: If you need to multiply a total time by an hourly rate (e.g., 10:30 hours * $20/hr), you must convert the time to a decimal first. Multiply the total time cell by 24 and change the cell format to "Number" or "General."
Troubleshooting
If your total is not calculating correctly, try these steps in order:
- Check for text formatting: If the SUM result is 0 or seems too low, your time entries might be formatted as text. Select the cells, look at the "Number" dropdown in the Home tab, and ensure it is set to "Time" or "General." If they are text, you may need to re-type them or use the "Text to Columns" tool to convert them.
- Verify the brackets: Ensure you used square brackets
[h]and not parentheses(h). Parentheses will not trigger the elapsed time calculation. - Check for hidden rows: The SUM function includes hidden rows. If you have filtered your list and only want to sum the visible cells, use the
SUBTOTAL(109, range)function instead. - Restart the application: If the formatting refuses to update, save your work, close Excel completely, and reopen the file.
Frequently Asked Questions
Why does my total show 2:00 instead of 26:00?
This happens because Excel's default time format resets every 24 hours. To fix this, go to Format Cells > Custom and change the format code to [h]:mm.
Can I add time that spans across midnight?
Yes, but a simple subtraction (End Time - Start Time) will result in a negative number or a series of hashtags (#####). To fix this, use the formula =MOD(End_Time - Start_Time, 1).
How do I add a specific number of minutes to a time?
Since Excel treats 1 day as 1, you must divide the minutes by 1440 (the number of minutes in a day). For example, to add 30 minutes to cell A1, use: =A1 + (30/1440).
Does this work in Google Sheets as well?
Yes. The process is almost identical. Go to Format > Number > Custom date and time, and select or create a format that displays "Elapsed hours."
How do I sum time if the values are in different formats?
Excel requires consistency. If some cells are "8:00" and others are "8.0", the SUM function will produce an incorrect result. Convert all entries to the HH:MM format before summing.