Calculate Working Hours Between Two Dates in Excel
By ExcelReady TeamUpdated 7 min read
The short answer
For whole days, count the working days and multiply by the hours in a working day: =NETWORKDAYS(A2,B2,holidays)*8. When the start and end include times, use a formula that counts the full days in between and then adds the part-days at each end, clipped to working hours with MEDIAN. Multiply the result by 24 to get hours.
Key takeaways
- =NETWORKDAYS(start,end,holidays)*8 gives working hours for whole days. It counts both the start and end dates.
- Excel stores times as fractions of a day, so multiply a time result by 24 to get hours.
- For exact start and end times, combine NETWORKDAYS for the full days with MEDIAN and MOD for the part-days.
- Use NETWORKDAYS.INTL when the weekend is not Saturday and Sunday.
On this page+
To calculate working hours between two dates in Excel, count the working days with NETWORKDAYS and multiply by the length of your working day: =NETWORKDAYS(A2,B2)*8. If the start and end also have times, such as a ticket opened at 13:00 on Monday and closed at 11:00 on Wednesday, you need a longer formula that trims each end to office hours. This guide covers both, for anyone measuring response times, project effort or service levels.
Whole days: NETWORKDAYS times hours per day#
When work starts at the beginning of one day and ends at the close of another, count the working days and multiply. NETWORKDAYS counts Monday to Friday between two dates and skips weekends:
=NETWORKDAYS(start_date, end_date, [holidays])Say an audit runs from Monday 2 March 2026 to Friday 13 March 2026, with a public holiday on Monday 9 March, and a working day is 8 hours:
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Task | Start | End | Hours/day | Holiday |
| 2 | Audit | 2 Mar 2026 | 13 Mar 2026 | 8 | 9 Mar 2026 |
=NETWORKDAYS(B2,C2,E2)*D2There are 10 weekdays from 2 to 13 March, minus the holiday, which leaves 9 working days. The result is 9 × 8 = 72 hours.
Two details matter:
- Both ends count. NETWORKDAYS includes the start and end dates, so Monday to Friday of one week is 5 days, not 4.
- Holidays need a range. For several holidays, list them in cells such as H2:H5 and use
$H$2:$H$5as the third argument, so the range stays put when you fill down.
The NETWORKDAYS function guide and the article on NETWORKDAYS and WORKDAY cover the function in more depth.
How Excel stores dates and times#
The exact formula below only makes sense once you know how Excel stores time. A date is a whole number of days, and a time is a fraction of a day:
| Value | What Excel stores |
|---|---|
| 2 March 2026 | 46083 |
| 12:00 (noon) | 0.5 |
| 18:00 | 0.75 |
| 2 March 2026 13:00 | 46083.5417 |
Two consequences follow. First, MOD(A2,1) strips the date and leaves only the time, because it returns the part after the whole number. Second, any time result is in days, so you multiply by 24 to get hours. The guide to calculating the difference between two times explains this with simple start and end times on one day.
To type a date with a time safely, build it from parts: =DATE(2026,3,2)+TIME(13,0,0). That avoids confusion between day-first and month-first date settings.
Exact working hours with start and end times#
When the start and end include times, use this formula. It assumes the start date-time is in A2, the end in B2, the start of the working day in E1 (9:00) and the end of the working day in E2 (17:00):
=((NETWORKDAYS(A2,B2)-1)*($E$2-$E$1)
+IF(NETWORKDAYS(B2,B2),MEDIAN(MOD(B2,1),$E$2,$E$1),$E$2)
-MEDIAN(NETWORKDAYS(A2,A2)*MOD(A2,1),$E$2,$E$1))*24You can type it on one line; the line breaks only make it easier to read. Here is what each part does:
(NETWORKDAYS(A2,B2)-1)*($E$2-$E$1)counts every working day but one as a full working day of 8 hours.MEDIAN(MOD(B2,1),$E$2,$E$1)takes the end time and clips it into office hours. MEDIAN of three values returns the middle one, so a time before 9:00 becomes 9:00 and a time after 17:00 becomes 17:00. This adds the hours worked on the last day.MEDIAN(NETWORKDAYS(A2,A2)*MOD(A2,1),$E$2,$E$1)clips the start time the same way and subtracts it, removing the part of the first day before work began.- The
IFand theNETWORKDAYS(A2,A2)*parts handle a start or end that falls on a weekend or holiday. *24turns the answer from days into hours.
To skip holidays, add the holiday range to every NETWORKDAYS in the formula, for example NETWORKDAYS(A2,B2,$H$2:$H$5).
Worked examples of the exact formula#
With a 9:00 to 17:00 day and no holidays, the formula gives these results:
| Start (A) | End (B) | Working hours |
|---|---|---|
| Mon 2 Mar 2026 13:00 | Wed 4 Mar 2026 11:00 | 14 |
| Fri 6 Mar 2026 15:00 | Tue 10 Mar 2026 10:30 | 11.5 |
| Sat 7 Mar 2026 10:00 | Mon 9 Mar 2026 11:00 | 2 |
Check the first row by hand: Monday 13:00 to 17:00 is 4 hours, Tuesday is a full 8, and Wednesday 9:00 to 11:00 is 2. That totals 14. In the second row, Friday gives 2 hours, the weekend is skipped, Monday gives 8 and Tuesday gives 1.5, which is 11.5. In the third row, the Saturday start is treated as Monday 9:00, so the answer is 2.
If you prefer to see hours and minutes, drop the *24 and format the cell with the custom format [h]:mm. The square brackets let the hours go past 24.
Different weekends: NETWORKDAYS.INTL#
NETWORKDAYS assumes Saturday and Sunday are the weekend. If your team works a different pattern, use NETWORKDAYS.INTL, which adds a weekend argument:
=NETWORKDAYS.INTL(A2,B2,7,$H$2:$H$5)*8| Weekend argument | Days off |
|---|---|
| 1 (default) | Saturday and Sunday |
| 7 | Friday and Saturday |
| 11 | Sunday only |
| "0000011" | Saturday and Sunday, written as a pattern |
| "0000001" | Sunday only, written as a pattern |
The pattern form uses seven digits from Monday to Sunday, where 1 means a day off. You can use NETWORKDAYS.INTL in place of every NETWORKDAYS in the exact formula too. It works in Excel 2010 and later. For the difference between counting days and finding a date, see NETWORKDAYS vs WORKDAY.
Common mistakes with working hours#
Most wrong answers come from one of these:
- Forgetting to multiply by 24. A result like 0.583 is a fraction of a day; × 24 gives 14 hours.
- Subtracting one day too few or too many. NETWORKDAYS counts both ends. Don't add or subtract 1 to "fix" it unless you mean to.
- Dates stored as text. If NETWORKDAYS returns #VALUE!, the dates are probably text. Rebuild them with DATE or convert them.
- Lunch breaks. The formulas count the whole span from 9:00 to 17:00. If an unpaid hour of lunch should come off, use 7 hours per day in the whole-day version.
- A holiday range that moves. Without
$signs, the holiday range shifts as you fill down and stops matching your list.
For tracking hours worked on each shift rather than elapsed working time, a timesheet in Excel is the better tool.
Practise it#
Try the exercise on this page: it turns a date range with one holiday into working hours. Then practise NETWORKDAYS and WORKDAY in a live spreadsheet, where every formula you type is checked instantly. For plain calendar days between dates, take the days between dates lesson or read the guide to counting days between two dates.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
The audit runs from B2 to C2, with one public holiday in E2, and a working day is D2 hours. Click G2 and calculate the working hours with NETWORKDAYS, then press Enter.
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Holiday | |||||||
| 2 | Working hours | |||||||
| 3 | ||||||||
| 4 | ||||||||
| 5 | ||||||||
| 6 |
Tip: NETWORKDAYS takes the start date, the end date and the holiday. Multiply its result by the hours per day.
Practise this in a lesson
Frequently asked questions
How do I calculate working hours between two dates in Excel?
For whole days, use =NETWORKDAYS(A2,B2)*8, replacing 8 with the length of your working day. Add a holiday range as the third argument to skip public holidays. For start and end times, use the MEDIAN-based formula in this guide.
Does NETWORKDAYS include the start and end date?
Yes. NETWORKDAYS counts both dates if they are working days. From Monday to Friday of the same week it returns 5, not 4.
How do I exclude holidays when counting working hours?
List the holiday dates in a range and add it as the third argument: =NETWORKDAYS(A2,B2,$H$2:$H$5)*8. Use $ signs so the range stays fixed when you fill down.
How do I calculate working hours with a Friday and Saturday weekend?
Use NETWORKDAYS.INTL with weekend code 7: =NETWORKDAYS.INTL(A2,B2,7,$H$2:$H$5)*8. Code 1 is Saturday and Sunday, and code 11 is Sunday only.
Why is my working hours result a strange decimal or a time?
Excel stores time as a fraction of a day. Multiply by 24 and format the cell as a number to see hours, or leave it as a fraction and use the [h]:mm format to show hours and minutes.