The NETWORKDAYS function in Google Sheets is essential for anyone who needs to calculate the number of working days between two specified dates. It plays a vital role in project management, scheduling, and any task requiring an understanding of time frames within a business context. This function automatically excludes weekends and can also account for holidays if specified, making it a powerful tool for accurate date calculations.
Syntax
NETWORKDAYS(start_date, end_date, [holidays])
- start_date: The beginning date from which to start counting working days.
- end_date: The ending date to which the working days are counted.
- [holidays]: (Optional) A range of one or more dates to exclude from the working day count, such as public holidays.
Example #1
=NETWORKDAYS("2023-10-01", "2023-10-10")
This function calculates the number of working days between October 1, 2023, and October 10, 2023, resulting in 6 days when weekends are excluded.
Example #2
=NETWORKDAYS("2023-10-01", "2023-10-10", {"2023-10-04"})
In this case, the function calculates the total working days while excluding October 4, 2023, leading to a total of 5 days.
Example #3
=NETWORKDAYS("2023-10-01", "2023-10-10", A1:A3)
Here, A1:A3 is the range of cells containing holiday dates. The function will count the working days between October 1 and 10, excluding dates listed in the range (such as public holidays), yielding a total of 4 workdays.
Error handling
- VALUE!: This error occurs when the provided dates are not valid date values. Ensure the dates are correctly formatted.
- NUM!: This error arises if the end date is earlier than the start date. Check that the start date precedes the end date.
- REF!: This error can occur if a reference to a cell for holidays is invalid. Verify that the range provided contains valid date entries.