logo
search
Function Problems

How to Calculate Working Hours with NETWORKDAYS in Excel

Maira MehtabMaira Mehtab Sep 22, 2026 868 views

Question details

The user needs a formula to calculate total working hours between a start date and an end date using the NETWORKDAYS function.

Product
Excel
Device & OS
not provided
Scenario
Calculating the total number of elapsed working hours between two given dates, while automatically accounting for weekends and optionally excluding holidays.
Observed behavior
A formula is required to convert elapsed working days into total working hours, handling cases where the end date might be blank by defaulting to the current date.
Before you start

Ensure your start and end dates are properly formatted as Date values in your spreadsheet to prevent the NETWORKDAYS function from returning calculation errors.

Solution 1Recommended

Using the NETWORKDAYS Formula to Calculate Working Hours

Multiply the result of the NETWORKDAYS function by 24 to convert elapsed working days into working hours.

The NETWORKDAYS function automatically calculates the number of working days between two dates, excluding weekends. By multiplying the total working days by 24, you can easily find the total working hours. You can also nest an IF function to handle missing end dates dynamically.

1
Select the output cell

Click on the cell where you want the calculated total working hours to appear.

2
Enter the working hours formula

Type the formula =24*NETWORKDAYS(D6,IF(E6="",TODAY(),E6)) and press Enter. This assumes your start date is in cell D6 and your end date is in E6.

3
Exclude specific holidays (optional)

If you need to exclude specific company holidays, add a holiday range as the third argument: =24*NETWORKDAYS(D6,IF(E6="",TODAY(),E6), H2:H10), assuming cells H2 through H10 contain your holiday dates.

Handling Blank End Dates: The IF function within this formula (IF(E6="",TODAY(),E6)) checks if the end date cell is blank. If it is empty, it automatically substitutes today's date as the end date for the calculation.
WPS Spreadsheet Solutions

Calculate Working Hours Seamlessly Using WPS Spreadsheet

You can perfectly apply the NETWORKDAYS formula in WPS Spreadsheet to calculate elapsed working hours. WPS Office provides an intuitive data processing interface and works identically with standard spreadsheet functions.

  1. 1. Open your spreadsheet in WPS Office: Launch WPS Spreadsheet and open the document containing your start and end dates.
  2. 2. Select the target cell: Click on the specific cell where the calculated hours will be displayed.
  3. 3. Apply the NETWORKDAYS formula: Input the formula =24*NETWORKDAYS(Start_Date_Cell, End_Date_Cell) in the formula bar and press Enter to instantly see the total working hours.
Fully compatible with Microsoft Excel formats (.xlsx) and formulas.Lightweight, fast, and runs smoothly on Windows, Mac, Linux, and mobile devices.Built-in function wizard makes it simple to select, apply, and troubleshoot complex date and time formulas.
QA img-9

Frequently Asked Questions

Does the NETWORKDAYS function include both the start and end dates in its calculation?

Yes, the NETWORKDAYS function is inclusive. It counts both the start date and the end date as working days as long as they do not fall on a weekend or a specified holiday.

How do I calculate working hours if my standard workday is 8 hours instead of 24?

To calculate hours based on an 8-hour workday, simply change the multiplier at the beginning of the formula from 24 to 8. Your adjusted formula will be =8*NETWORKDAYS(start_date, end_date).

Why is my NETWORKDAYS formula returning a #VALUE! error?

A #VALUE! error typically occurs if the start date or end date is not recognized as a valid date by the spreadsheet. Check your referenced cells and ensure they are formatted as Dates rather than text strings.

Can I customize the weekend days used in the formula?

Yes. If your weekends fall on days other than Saturday and Sunday, you should use the NETWORKDAYS.INTL function instead. It includes an additional argument that allows you to specify exactly which days of the week should be considered weekends.