How to Calculate Days Interval in Excel
Calculating days interval in Excel is essential for project management, scheduling, and time-based analysis. This guide covers the basic formula, workdays-only calculation, custom day counts, and practical examples.
Basic Days Interval Formula
The simplest way to calculate days between two dates in Excel is to use the DATEDIF function or basic subtraction.
Basic Formula
=B2-A2
Where A2 contains the start date and B2 contains the end date.
This returns the number of days between the two dates. For example, if A2 is 1/1/2023 and B2 is 1/10/2023, the result will be 9.
Note: This formula counts all days, including weekends. For workdays only, use the NETWORKDAYS function.
Workdays Only Formula
To calculate only business days (excluding weekends and holidays), use the NETWORKDAYS function.
Workdays Formula
=NETWORKDAYS(start_date, end_date)
For example: =NETWORKDAYS(A2, B2)
This function automatically excludes Saturdays and Sundays. For holidays, you can add a range of holiday dates as a third parameter.
With Holidays
=NETWORKDAYS(start_date, end_date, holidays_range)
Example: =NETWORKDAYS(A2, B2, C2:C10)
Custom Day Counts
For more complex scenarios, you can use the DATEDIF function to count specific day types.
DATEDIF Function
=DATEDIF(start_date, end_date, "d")
Where "d" counts days, "m" counts months, "y" counts years, and "md" counts days within the month.
For example, =DATEDIF(A2, B2, "d") will return the same result as the basic subtraction method.
Practical Examples
Here are some common scenarios and their Excel formulas:
Example 1: Basic Day Count
Start Date: 5/1/2023
End Date: 5/15/2023
Formula: =B2-A2
Result: 14 days
Example 2: Workdays Only
Start Date: 5/1/2023 (Monday)
End Date: 5/15/2023 (Monday)
Formula: =NETWORKDAYS(A2, B2)
Result: 10 workdays (excluding weekends)
Example 3: With Holidays
Start Date: 12/24/2023 (Saturday)
End Date: 1/1/2024 (Monday)
Holidays: 12/25/2023 (Christmas)
Formula: =NETWORKDAYS(A2, B2, C2)
Result: 1 workday (excluding weekend and holiday)