Calculating the number of calendar days between two dates is a common task in business, finance, and project management. While Excel offers several built-in functions, calculating calendar days between two dates isn't as straightforward as it might seem. This is because Excel's default date functions count business days, excluding weekends and holidays. Here, we'll explore an Excel formula that calculates calendar days between two dates, considering both weekdays and weekends.
![How to calculate time between two dates in Years, Months & Days [Excel Formula]](https://i.pinimg.com/originals/d3/c9/90/d3c990f0122e0201eec12420841162c7.png)
Before we dive into the formula, let's understand why we need a custom solution. Excel's built-in functions like NETWORKDAYS and WORKDAY are designed for calculating business days, excluding weekends and holidays. However, if you're working on a project that spans weekends or need to calculate the exact number of days between two dates, including weekends, you'll need a different approach.

Understanding the Excel Formula for Calendar Days
The formula we'll use is a combination of Excel's DATE, DAY, and INT functions. It calculates the total number of days between two dates, including weekends. Here's the formula:

INT((DATE(YEAR(end_date), MONTH(end_date), 1) - DATE(YEAR(start_date), MONTH(start_date), 1)) / 7) * 7 + DAY(end_date) - DAY(start_date)
Breaking Down the Formula

The formula works by first calculating the number of weeks between the two dates and then adding the remaining days. Let's break it down:
DATE(YEAR(end_date), MONTH(end_date), 1)andDATE(YEAR(start_date), MONTH(start_date), 1)create date serial numbers for the first day of each month.- The subtraction of these two values gives the total number of days between the two dates.
- Dividing this by 7 gives the number of weeks between the two dates.
- Multiplying this by 7 gives the total number of days accounted for in these weeks.
- Subtracting the day of the month from the start date and adding the day of the month from the end date gives the remaining days.
Using the Formula

To use this formula, replace start_date and end_date with the actual dates you want to calculate the calendar days between. For example, if your start date is January 1, 2022, and your end date is January 15, 2022, the formula would look like this:
INT((DATE(YEAR(D2), MONTH(D2), 1) - DATE(YEAR(C2), MONTH(C2), 1)) / 7) * 7 + DAY(D2) - DAY(C2)
Assuming your start date is in cell C2 and your end date is in cell D2.

Calculating Calendar Days with Weekends and Holidays
While the above formula calculates calendar days, including weekends, it doesn't account for holidays. If you need to exclude holidays from your calculation, you can use the NETWORKDAYS function with an array of holiday dates. Here's how:




















NETWORKDAYS(start_date, end_date, [holidays])
Replace start_date and end_date with your actual dates, and replace [holidays] with an array of holiday dates. For example, if your start date is in cell C2, your end date is in D2, and your holidays are listed in cells E2:E5, the formula would look like this:
NETWORKDAYS(C2, D2, E2:E5)
Understanding the NETWORKDAYS Function
The NETWORKDAYS function counts the number of whole workdays between two dates, excluding weekends and holidays. It uses the following logic:
- Starts counting from the start date.
- Excludes weekends (Saturday and Sunday).
- Excludes any dates in the [holidays] argument.
- Stops counting at the end date.
Using the NETWORKDAYS Function
To use the NETWORKDAYS function, you need to list your holiday dates in a range. For example, if your holidays are January 1, 2022, January 3, 2022, and January 5, 2022, you would list them in cells E2:E4 like this:
| Holiday Dates |
|---|
| 2022-01-01 |
| 2022-01-03 |
| 2022-01-05 |
Then, you can use the NETWORKDAYS function as shown earlier.
In your Excel calculations, it's essential to understand the difference between business days and calendar days. While Excel's default functions calculate business days, you can use the formulas above to calculate calendar days, including weekends and holidays. This can help you plan projects more accurately and make better-informed decisions. Happy calculating!