docs / articles / Excel Formula: Calculate Calendar Days Between Two Dates

Excel Formula: Calculate Calendar Days Between Two Dates

Eric Jul 09, 2026 2026-07-09 04:40:47

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]
How to calculate time between two dates in Years, Months & Days [Excel Formula]

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.

Calculate Number of Days Between Two Dates in Excel - TheAppTimes
Calculate Number of Days Between Two Dates in Excel - TheAppTimes

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:

Calculate Number of Days Between Two Dates in Excel (8 Quick Tricks)
Calculate Number of Days Between Two Dates in Excel (8 Quick Tricks)

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

Calculate Working Days between two Dates in Excel: Find Workdays Excluding Holidays & Weekends
Calculate Working Days between two Dates in Excel: Find Workdays Excluding Holidays & Weekends

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) and DATE(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

Excel Formula to Calculate Number of Days Between Two Dates - ExcelDemy
Excel Formula to Calculate Number of Days Between Two Dates - ExcelDemy

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.

Get Difference between Two Dates in Excel | Calculate difference between Two Dates in Excel | Excel
Get Difference between Two Dates in Excel | Calculate difference between Two Dates in Excel | Excel

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:

How to Use 20+ Date Formulas in Excel
How to Use 20+ Date Formulas in Excel
How to calculate elapsed time/days/months/years between two datetimes in Excel?
How to calculate elapsed time/days/months/years between two datetimes in Excel?
an image of a computer keyboard with the text auto save on it
an image of a computer keyboard with the text auto save on it
Excel DATEDIF function to get difference between two dates
Excel DATEDIF function to get difference between two dates
Calculate Difference between Two Dates in Excel: Get Number of Years Months Days with Excel Formula
Calculate Difference between Two Dates in Excel: Get Number of Years Months Days with Excel Formula
How to fill date by week in Excel quickly and easily?
How to fill date by week in Excel quickly and easily?
an image of a calendar in microsoft office 365 with the date and time tab open
an image of a calendar in microsoft office 365 with the date and time tab open
Calender in Excel ‼️ Amazing Excel trick using data validation and conditional formatting ✅ #Excel
Calender in Excel ‼️ Amazing Excel trick using data validation and conditional formatting ✅ #Excel
SUMIF Between Two Dates - How To Sum Values?
SUMIF Between Two Dates - How To Sum Values?
TECH-004 Calculate total days between two dates in Excel
TECH-004 Calculate total days between two dates in Excel
How To Calculate The Difference Between Two Dates in Excel - ExcelDataPro
How To Calculate The Difference Between Two Dates in Excel - ExcelDataPro
Auto-Write Dates in Excel With This simple Trick in Seconds!📅  #excel #excelshorts
Auto-Write Dates in Excel With This simple Trick in Seconds!📅 #excel #excelshorts
Create a date sequence in Excel and auto fill date series
Create a date sequence in Excel and auto fill date series
Excel Autofill - how to quickly enter Months, Days, Dates and Numbers without typing
Excel Autofill - how to quickly enter Months, Days, Dates and Numbers without typing
How to Calculate Hours Between Two Times in Excel (6 Methods) - ExcelDemy
How to Calculate Hours Between Two Times in Excel (6 Methods) - ExcelDemy
2 Ways To Display Weekday For A Date In Excel
2 Ways To Display Weekday For A Date In Excel
calculate expiry date in excel | Excel Tutorials | how to calculate expiry date in Excel #Excel2022
calculate expiry date in excel | Excel Tutorials | how to calculate expiry date in Excel #Excel2022
a calendar with the date and time for january to march 2013, including dates on each page
a calendar with the date and time for january to march 2013, including dates on each page
Top 6 Excel Date Formulas
Top 6 Excel Date Formulas
How to insert dates from a Popup Calendar (date picker) in Excel – user guide | XLTools
How to insert dates from a Popup Calendar (date picker) in Excel – user guide | XLTools

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!