To insert a time duration in Excel, enter the time using the format hh:mm:ss (hours:minutes:seconds) and apply the custom number format [h]:mm:ss to ensure that totals exceeding 24 hours do not reset to zero. This allows Excel to treat the entry as a cumulative span of time rather than a specific time of day on a clock.

Excel handles time as a fraction of a day. For example, 12 hours is stored as 0.5. When you enter time, Excel often defaults to a "Time of Day" format. If you are tracking project hours, athlete lap times, or employee shifts, you need a "Duration" format. Without the correct formatting, a total of 25 hours will appear as 1 hour because Excel assumes you have passed midnight and started a new day. By using square brackets around the hour marker, you tell Excel to accumulate the hours instead of wrapping them around a 24-hour clock.

What You'll Need

  • A computer with Microsoft Excel installed (works on Windows and macOS).
  • A dataset of time values or a planned list of durations to track.
  • Basic familiarity with selecting cells and accessing the Ribbon menu.

Step-by-Step

  1. Enter Your Data: Click on the cell where you want to record the duration. Type the time using colons. For example, if a task took 5 hours and 30 minutes, type 5:30. If it took 12 hours, 15 minutes, and 10 seconds, type 12:15:10. Press Enter. Note that if you only type 5:30, Excel may assume it is 5:30 AM. This is fine for now, as the formatting step will correct how it is displayed.
  2. Select the Target Cells: Click and drag your mouse to highlight all the cells containing the durations you entered, as well as the cell where you intend to calculate the total sum.
  3. Open the Format Cells Menu: Right-click on the selected area and choose Format Cells... from the context menu. Alternatively, you can use the keyboard shortcut Ctrl + 1 (Windows) or Command + 1 (Mac).
  4. Navigate to Custom Formatting: In the Format Cells dialog box, ensure you are on the Number tab. In the Category list on the left side, scroll down to the bottom and select Custom.
  5. Enter the Duration Code: On the right side, you will see a text box under the word "Type:". Delete whatever is currently in that box and type exactly: [h]:mm:ss. The square brackets around the 'h' are the most critical part of this process; they signal to Excel that the hours should be cumulative.
  6. Apply and Confirm: Click OK. Your cells will now display the time as a duration. If you entered 25:00:00, it will now correctly show 25:00:00 instead of 1:00:00.
  7. Calculate the Total: To find the total duration of multiple entries, select the cell at the bottom of your list and use the SUM function. Type =SUM(, select the range of cells containing your durations, and close the parenthesis ). Press Enter. Because you already formatted the total cell as [h]:mm:ss, the sum will be accurate regardless of how many days it spans.

Common Mistakes

One of the most frequent errors is entering time as decimals. Many users type "5.5" to represent five and a half hours. However, Excel treats 5.5 as 5.5 days (or 132 hours). To enter time that Excel recognizes as a duration, you must use the colon (:) separator. If you have a list of decimals and need to convert them to time, you must divide the decimal value by 24 before applying the time formatting.

Another common mistake is neglecting the square brackets in the custom format. If you use h:mm:ss, Excel uses a 24-hour clock. If your total duration is 26 hours, the cell will display 2:00:00. This leads to massive accounting errors in payroll or project management spreadsheets. Always verify that the brackets are present when dealing with totals.

Users also frequently confuse "Time of Day" with "Duration." If you subtract a start time (e.g., 9:00 AM) from an end time (e.g., 5:00 PM), the result is a duration. However, if the shift crosses midnight (e.g., 10:00 PM to 6:00 AM), a simple subtraction will result in a negative number or a series of hashtags (#######) because Excel cannot display negative time by default. In these cases, you need a specific formula to handle the date crossover.

Tips

For faster data entry, you can use the shortcut Ctrl + Shift + : (colon) to insert the current system time into a cell. While this inserts a "time of day," you can quickly convert it to a duration by applying the custom format mentioned above.

If you need to calculate the total duration in terms of decimal hours (for example, to multiply hours by an hourly pay rate), you cannot simply multiply the formatted time cell by the rate. Since Excel stores time as a fraction of a day, you must multiply the time result by 24. For example, if cell A1 contains 10:00 (10 hours) and B1 contains the rate of $20, the formula should be =A1 * 24 * B1. This converts the internal Excel value (0.4166) into the number 10 before multiplying by the dollar amount.

To make your spreadsheet more readable, consider using Conditional Formatting. You can set a rule to highlight any duration that exceeds a certain threshold (e.g., any task taking more than 40 hours) to quickly identify outliers or bottlenecks in your project timeline.

Troubleshooting

The cell shows hashtags (#######) instead of time: This usually happens for two reasons. First, the column may be too narrow to display the full time string; try widening the column by double-clicking the boundary between column headers. Second, the result of your calculation is a negative time value. Excel cannot display negative time in the standard 1900 date system. To fix this for shifts crossing midnight, use the formula =MOD(End_Time - Start_Time, 1). The MOD function ensures the result is always positive.

The sum is incorrect or seems too low: Check the formatting of the total cell. If the total is 30 hours but the cell shows 6:00:00, you have used h:mm:ss instead of [h]:mm:ss. Go back to Format Cells > Custom and add the square brackets around the 'h'.

Excel is converting my duration to a date: If you type 12:00 and Excel turns it into 12-Jan or a similar date, it is because the cell was previously formatted as a Date. Clear the formatting by selecting the cell, going to the Home tab, and selecting "General" from the Number format dropdown before re-applying the Custom duration format.

Frequently Asked Questions

How do I enter minutes only in a duration?

To enter only minutes, you must still use the hour placeholder. For 45 minutes, type 0:45. If you type 45, Excel treats it as 45 full days.

Can I sum durations that are in different formats?

Yes, as long as they are all recognized as time values by Excel. The SUM function will add them correctly regardless of whether some are displayed as h:mm and others as h:mm:ss, provided the total cell is formatted as [h]:mm:ss.

How do I convert a duration to total minutes?

To convert a duration in cell A1 to total minutes, use the formula =A1 * 24 * 60 and format the resulting cell as "General" or "Number." This multiplies the day-fraction by 24 hours and then by 60 minutes.

Why does my time look like a decimal (e.g., 0.25)?

This is the raw value Excel uses. 0.25 equals one-quarter of a day, or 6 hours. To fix this, change the cell format from "General" to "Time" or use the Custom [h]:mm:ss format.

Does this work in Google Sheets as well?

Yes, the logic is very similar. In Google Sheets, you go to Format > Number > Custom date and time and select or create a duration format that allows hours to exceed 24.