How to Write Duration in Excel (Hours, Minutes, Time)
In this article
To write a duration in Excel, type a value in the form hours:minutes:seconds (for example 3:25:00 for 3 hours 25 minutes) and format the cell as [h]:mm so Excel treats it as elapsed time rather than a clock time. If you only type 3:25, Excel will usually read it as 3:25 AM, and a total that passes 24 hours will wrap back to zero unless you use the bracketed [h] format. Everything below works the same on Excel for Windows, Mac, the web version and the mobile apps, though menu labels can differ slightly by version, device or region.
What You'll Need
- Microsoft Excel (desktop or web) or a free alternative that understands Excel time formats.
- Knowledge of whether you need elapsed time (a length, like a shift of 9 hours) or clock time (a point in the day, like 9:00 AM). The formatting differs.
- Your input values in a consistent order: hours, minutes, seconds.
Step-by-Step
- Pick the right cell and make its column wide. Click a cell, then widen the column by dragging the boundary in the column header. Excel shows
#####when a time value does not fit, which looks like an error but is not one. - Type the duration using colons. Enter
2:30for 2 hours 30 minutes,0:45for 45 minutes, or1:15:30for 1 hour 15 minutes 30 seconds. Always include the hours placeholder, even as a zero, so Excel reads minutes and seconds in the right positions. - Press Enter and check what Excel displays. A value typed as
2:30often shows as2:30 AMor2:30. Either way, the underlying number is the same; only the format differs. - Apply an elapsed-time format. Select the cells, right-click and choose Format Cells, then the Number tab and the Custom category. In the Type box, type
[h]:mmand click OK. The bracketed h tells Excel to keep counting hours past 24 instead of resetting at midnight. Use[h]:mm:ssif you track seconds. - Add durations together. Put your values in a column and use a simple sum, such as
=SUM(A2:A10). Keep the result cell formatted as[h]:mmso totals like 37:20 display correctly instead of showing 13:20. - Subtract to get elapsed time. With a start in
A2and an end inB2, enter=B2-A2. If a shift crosses midnight (start 22:00, end 06:00), use=MOD(B2-A2,1)so the result is 8:00 rather than a negative value full of hash marks. - Enter durations over 24 hours as a number. For something like 30 hours, type
30:00and format as[h]:mm. Typing30:00in a General cell may be converted to 6:00 AM, so format the cell first, then type. - Convert a decimal to a duration. If you have 2.5 and want 2:30, divide the result by 24 in the formula, for example
=A2/24, and format the cell as[h]:mm. Excel stores one day as the number 1, so hours are fractions of 1 and must be divided by 24. - Convert a duration back to decimal hours. Multiply by 24 and format as a number:
=A2*24. For minutes, use=A2*1440. This is the format payroll and billing spreadsheets usually need. - Use a custom text label if you need readable output. To show "2h 30m", use
=INT(A2*24)&"h "&MINUTE(A2)&"m". The result is text, so it cannot be summed; keep a numeric copy in a hidden or adjacent column.
Common Mistakes
Using h:mm instead of [h]:mm. This is the single most common problem. Plain h:mm shows only the hours portion of a day, so 26 hours appears as 2:00. The brackets are what allow hours to accumulate.
Typing decimal hours into a time-formatted cell. Entering 1.5 in a cell formatted [h]:mm displays as 36:00, because 1.5 means one and a half days, not one and a half hours. Enter decimals in General format, then divide by 24.
Letting Excel guess. Without leading zeros and colons, text like 1.30 may become a decimal number rather than 1 hour 30 minutes. Type 1:30 with a colon, or prefix an apostrophe to force text if that is what you want.
Negative durations. Excel does not display negative time in the default date system; you get #####. Fix the formula with MOD or swap the operands rather than trying to format your way out of it.
Mixing clock times and durations in one column. A column formatted h:mm AM/PM is for points in the day. Do not put elapsed lengths in it and expect totals to work.
Tips
- Format the column as
[h]:mmbefore typing, so entries over 24 hours are accepted cleanly the first time. - Keep raw start and end times and calculate duration with a formula rather than typing the difference by hand. Corrections then update automatically.
- Use a helper column for decimal hours (multiply by 24) when you need to pay or bill people; keep the displayed
[h]:mmcolumn for reading. - Press Ctrl+1 (Windows) or Cmd+1 (Mac) to open Format Cells quickly.
- If Excel auto-converts your typing into a date, undo it with Ctrl+Z, format the cell as
[h]:mmfirst, then retype.
Troubleshooting
If totals keep resetting at 24 hours, the cell is formatted h:mm. Reapply [h]:mm through Format Cells. If the number behind the format is already correct, the display will fix itself immediately.
If you see hash marks, widen the column first. If they remain, the value is negative, which points to a subtraction order problem or a midnight crossing.
If a cell refuses to accept 25:00, it is formatted as General or as a date. Format it as [h]:mm and re-enter the value; do not retype it repeatedly into an unchanged cell.
If your sum returns zero, one or more entries were stored as text. Left-aligned times are a clue. Re-enter them with colons, or use Data > Text to Columns to convert the column.
If formulas produce odd decimals, check whether you divided by 24 twice. A duration already formatted as time should be multiplied by 24 to get decimal hours, not divided.
If mobile behaves differently, the Excel mobile app has fewer format options in its quick menu. Open the full Format Cells dialog or finish the formatting on desktop or the web, where the Custom category is available.
Frequently Asked Questions
Why does Excel show 6:00 instead of 30:00?
Because the cell is using a 12- or 24-hour clock format without brackets. Apply the custom format [h]:mm and the full 30 hours will show.
How do I enter 90 minutes?
Type 1:30 and format the cell as [h]:mm. You can also type 0:90, which Excel converts to 1:30 automatically.
Can I add hours and minutes in separate columns?
Yes. Use =A2/24+B2/1440, where A2 holds hours and B2 holds minutes, then format the result as [h]:mm.
How do I turn a duration into a decimal for payroll?
Multiply by 24 for hours and by 1440 for minutes, and format the result as a number with the decimal places you need.
Why do I get a negative time after a night shift?
The end time is earlier in the day than the start time. Use =MOD(end-start,1) to get the true elapsed duration.
Does this work in Google Sheets and other spreadsheets?
The [h]:mm custom format works in Google Sheets and LibreOffice Calc as well, with the same logic that one day equals 1.