How-to recipes · Dates and times

How to sum time over 24 hours in Excel

Add up hours and minutes that go beyond 24 hours with the [h]:mm number format, convert the total to decimal hours, and avoid the reset-to-zero trap.

Beginner SUM TEXT ROUND MOD INT

You add up a week of working hours: 8:30, 9:15, 7:45, 8:50 and 6:40. The total should be 41 hours, but Excel shows 17:00. Nothing is wrong with the sum; it is the display. Excel stores times as fractions of a day, and the normal time format shows only the time of day, so every full 24 hours disappears like a clock passing midnight. One custom number format fixes it, and a multiplication turns the total into decimal hours for payroll.

The example data

Daily working hours in B2:B6, entered as times (8:30 means eight hours and thirty minutes).

Step 1: sum the times

=SUM(B2:B6) adds the values correctly. Internally the result is 1.708333 days. With the default time format h:mm, the cell shows 17:00, which is the leftover after one full day of 24 hours.

Step 2: apply the [h]:mm format

  1. Select the total cell.
  2. Press Ctrl+1 [Mac: Cmd+1] to open Format Cells and choose Custom.
  3. Type [h]:mm in the Type box and click OK.
B7fx=SUM(B2:B6)
AB
1DayHours
2Mon8:30
3Tue9:15
4Wed7:45
5Thu8:50
6Fri6:40
741:00

With the [h]:mm format the total shows 41:00. With h:mm it would show 17:00.

Result: 41:00

The square brackets tell Excel to show elapsed hours instead of the hour of the day, so the count keeps going past 24. The same works for other units: [m] shows total minutes (2460 here) and [h]:mm:ss includes seconds. Number formats are explained in Number formats and custom format codes.

Total as decimal hours

Payroll and invoicing need hours as a number (41 or 41.5), not as a time. Multiply by 24, the number of hours in a day, and format the result as a Number:

Formula
=SUM(B2:B6)*24

The result is 41. Multiply that by an hourly rate to get the pay: =SUM(B2:B6)*24*C1 with the rate in C1. Do not multiply the time-formatted value by the rate directly; 41:00 times 20 would give 34.17 (the fraction of days times 20), not 820. More on this in How to convert decimal hours to time in Excel.

Showing the total as text

When the total goes into a sentence or a label, use TEXT with the same bracket code: ="Total this week: "&TEXT(SUM(B2:B6),"[h]:mm") returns Total this week: 41:00. TEXT with "h:mm" would again show 17:00.

Microsoft 365 and older versions

There is no difference here: the [h]:mm format and the formulas above work the same in Microsoft 365, Excel 2016, 2019 and Excel for the web. In Microsoft 365 you can calculate a column of durations with one formula, such as =C2:C6-B2:B6 for end minus start times, and sum it directly.

Durations calculated from start and end times

If each row has a start and an end time, the duration is =C2-B2. For shifts that pass midnight (22:00 to 06:00) the plain subtraction is negative and shows ####; use =MOD(C2-B2,1), which adds a day when the end is earlier than the start. Overtime calculations built on this are in How to calculate overtime in Excel.

Pitfalls

  • Times stored as text. Values like 8:30 pasted from another system may be text, and SUM ignores text, so the total is too low or 0:00. Check with =ISNUMBER(B2); convert with =--B2 or =TIMEVALUE(B2).
  • Typing 8.30 instead of 8:30. A full stop makes a decimal number (8.3 days!). Use a colon for times.
  • Negative times display as #### in the default 1900 date system. Rearrange the calculation (for example show time remaining as a positive number) or use decimal hours.
  • Rounding. Times are fractions with many decimals; =SUM(B2:B6)*24 may give 40.9999999. Wrap it in ROUND: =ROUND(SUM(B2:B6)*24,2).
  • Format the total cell only. The daily cells can keep h:mm, because each is under 24 hours.
Tip. Excel's handling of dates and times as numbers is covered in Dates and times: serial numbers, date math and working days. For working days rather than hours, see How to count working days between two dates in Excel.
⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 12 KB

More how-to recipes