Calculate Time Duration in Excel

If you just need to calculate time duration in excel and move on, the boxed answer at the top is all you need. The rest of this page is for when you want to understand why it works in Excel, adapt it to a trickier version, or make it robust enough to hand to a colleague. We keep the opening short on purpose — the depth is here when you want it, not in your way when you don’t.

Exact answer

In Excel: sum the cells normally with =SUM(B2:B20), then format the result as [h]:mm — the square brackets are what stop the total resetting at 24 hours.

On this page7
ƒxHours & Duration CalculatorLive
Duration
8:00

8.00 decimal hours

=(B2-A2+(B2<A2))*24-C2/60
=SUM(B2:B20)
Ctrl+CthenCtrl+Shift+V+Cthen+Ctrl+VPaste values · WindowsMac

Need it as an auditable file?

Ships inside the linked template — formula-driven, unlocked, audit-ready.

View template

What this does

Excel stores a time as a fraction of a day: 6:00 is 0.25, 12:00 is 0.5. Adding times is therefore ordinary arithmetic, and the whole difficulty is display. The standard h:mm format shows a clock time, so a total of 30 hours displays as 6:00 — it has silently dropped the whole day. The custom format [h]:mm tells Excel to let the hours accumulate past 24. To convert a time total into a decimal number of hours for a rate calculation, multiply by 24: =SUM(B2:B20)*24 formatted as a plain number gives 30.5, which times an hourly rate gives money. Times crossing midnight need =B2-A2+(B2<A2) so the negative half-day is corrected. The same idea underpins a lot of everyday Excel work, so the few minutes spent getting it right here pay back across every sheet you build afterwards. Treat it as a pattern, not a one-off, and it stops being something you look up and starts being something you reach for. For “calculate time duration in excel”, the reliable version is a short checking loop, not just the first command that appears to work. Run it on a deliberately small range first, watch how the affected cells change, and only then apply the same setup to the full sheet. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That is what makes a calculation you can defend to a CFO or an auditor useful in real work: repeatable, auditable, and not dependent on memory or luck.

A worked example

Daily hours in B2:B8 as 7:30, 8:15, 6:45, 8:00, 7:45, 4:30, 0:00. =SUM(B2:B8) with the default h:mm shows 18:45, which is wrong — the true total is 42:45. Select the cell, press Ctrl+1 ▸ Custom, enter [h]:mm, and it reads 42:45. For pay at €18.50/hour: =SUM(B2:B8)*24*18.5 formatted as currency gives €790.88. A shift from 22:00 to 06:00 is =B2-A2+(B2<A2) → 8:00, where a plain subtraction returns ####. Timesheets, shift totals and project hours all go wrong in the same two places — the 24-hour wrap and the missing ×24 — and both are one formatting decision away from correct. One habit worth forming early: name the cells that hold your inputs, so the formula reads in plain language instead of a string of cell addresses. A reviewer — or you in three months — can then follow the logic without decoding what B7 and D2 were supposed to mean, which is most of what makes a sheet maintainable.

In Google Sheets

If you are in Google Sheets rather than Excel, the good news is that the formula shown here is identical and the workflow barely changes — menus sit across the top instead of in a ribbon, and a few function names differ slightly, but anything you build here moves across with little or no rework. Keep this page bookmarked for the next time the same question comes up. Better still, rebuild the example once in your own sheet — doing it yourself, with the tool above to check against, is what turns a copied formula into a technique you own. The short version of “calculate time duration in excel”: the answer is at the top of this page, the tool proves it on your own numbers, and the sections above explain why it holds so the next variation does not stump you. Excel rewards people who reference cells instead of typing values and who keep inputs separate from formulas, because that is what makes a result you can audit months later. Build it once, deliberately, with the live tool as a check, and you convert a one-off lookup into a reusable skill — which is the whole point of learning the why and not just the what.

Common mistakes

  • Leaving the total in h:mm, which wraps at 24 hours and quietly under-reports the week.
  • Typing 7.30 instead of 7:30, which Excel stores as the number seven-point-three, not seven and a half hours.
  • Multiplying a time total directly by an hourly rate without the ×24, which produces a figure about 24 times too small.
  • Subtracting an end time from a start time across midnight and getting ####, the display of a negative time.
  • Mixing text entries like "8 hrs" into the column, which SUM ignores without warning.

Frequently asked questions

How do I add up hours in Excel?

Use =SUM(range) as normal, then format the result cell as the custom format [h]:mm. Without the square brackets the total wraps at 24 hours.

Why does my time total reset after 24 hours?

The cell is formatted as a clock time. Press Ctrl+1 ▸ Custom and enter [h]:mm — the brackets tell Excel to keep counting past a day.

How do I convert a time total to decimal hours?

Multiply by 24 and format as a plain number: =SUM(B2:B20)*24 turns 7:30 into 7.5, which is what an hourly rate needs.

How do I calculate hours across midnight?

=B2-A2+(B2<A2). The comparison adds a whole day when the end time is earlier than the start, which is exactly the correction a night shift needs.

Other ways people ask this

This is also commonly searched as “how to calculate duration in excel”, “how to calculate time duration in excel” and “how to calculate duration of time in excel”. They describe the identical operation, so you are in the right place no matter how you phrased it.

Why do people search for this in so many different ways?

Because the same task has many names. “how to calculate duration in excel”, “how to calculate time duration in excel”, “how to calculate duration of time in excel” all point at the one operation explained on this page, which is why they all lead here.