Calculate days between two dates

How to Calculate Days Between Two Dates: Formula and Examples

To calculate days between two dates, you need a start date, an end date, and a clear counting method. Although the calculation may seem simple, the answer can change depending on whether you include the starting date, the ending date, or both.

Finding the number of days between two dates is useful when planning projects, checking delivery times, organizing events, tracking subscriptions, calculating travel durations, or measuring the time left before a deadline.

You can count the days manually, use a spreadsheet formula, or enter both dates into a days between dates calculator. An online tool is usually the fastest option because it automatically handles different month lengths, year changes, and leap years.

Calculate the Days Between Your Dates

Select a start date and an end date to find the exact number of calendar days between them.

Calculate the Days Between Your Dates

Select a start date and an end date to find the exact number of calendar days between them.

Button text: Use Days Between Dates Calculator

Button link: Add the URL of your Days Between Dates Calculator page.

What Does “Days Between Two Dates” Mean?

The date difference between two dates is the amount of time that passes from the starting date to the ending date.

For example, suppose the start date is March 5 and the end date is March 20.

Using standard elapsed-day counting:

March 20 − March 5 = 15 days

The result is 15 days because March 5 is treated as the starting point. It is not counted as a completed day.

However, the answer becomes 16 days when you include both March 5 and March 20:

15 + 1 = 16 days

This is the difference between exclusive and inclusive date counting. Before using a calculation for a booking, deadline, leave period, or payment, check which method applies.

Basic Formula for Calculating Days Between Dates

The basic formula is:

Number of days = End date − Start date

For example:

  • Start date: June 10
  • End date: June 25
  • Calculation: 25 − 10
  • Result: 15 days

This method is easy when both dates fall within the same month.

For inclusive counting, use:

Inclusive number of days = End date − Start date + 1

Adding one includes the starting date in the final total.

The formula becomes more difficult when the dates fall in different months or years because months do not all contain the same number of days.

How to Calculate Days Between Two Dates Step by Step

You can manually calculate the calendar days between dates by dividing the date range into smaller parts.

Step 1: Identify the Start and End Dates

Write down both dates and confirm which one comes first.

For example:

  • Start date: January 28
  • End date: February 5

Step 2: Count the Remaining Days in the First Month

January has 31 days.

After January 28, the following days pass before February begins:

  • January 29
  • January 30
  • January 31

That gives you three elapsed days in January.

Step 3: Count the Days in the Final Month

From February 1 to February 5, five more days pass.

Step 4: Add Both Results

3 + 5 = 8 days

The standard date difference between January 28 and February 5 is eight days.

For an inclusive result, add one:

8 + 1 = 9 days

This includes January 28 and February 5 in the count.

Inclusive vs Exclusive Date Counting

Inclusive and exclusive counting often produce different answers, even when the same two dates are used.

Exclusive Date Counting

Exclusive counting measures the time that passes after the starting date.

For example:

  • Start date: Monday
  • End date: Tuesday
  • Elapsed time: 1 day

Monday is the starting point, and one full day passes before Tuesday is reached.

Standard date subtraction usually follows this method.

Inclusive Date Counting

Inclusive counting includes both the start and end dates.

Using the same example:

  • Monday is counted
  • Tuesday is counted
  • Inclusive total: 2 days

Inclusive counting may be used for:

  • Event schedules
  • Leave periods
  • Travel itineraries
  • Rental periods
  • Medical treatment schedules
  • Promotional campaigns
  • Hotel bookings
  • Attendance records

Always confirm the required counting method before making an important decision based on the result.

How to Use a Days Between Dates Calculator

A date difference calculator is useful when your date range covers different months, several years, or a leap day.

The process is usually simple:

  1. Select the start date.
  2. Select the end date.
  3. Choose whether the start date should be included.
  4. Choose whether the end date should be included.
  5. Click the calculate button.
  6. Review the result.

Depending on the calculator, the answer may be displayed as:

  • Total calendar days
  • Complete weeks and remaining days
  • Months and days
  • Years, months, and days
  • Weekdays and weekend days

Check the selected dates and settings before using the result for a deadline, booking, payment, or legal period.

Examples of Calculating Days Between Dates

The following examples show how the calculation works in different situations.

Example 1: Dates Within the Same Month

Start date: April 4
End date: April 18

Standard calculation:

18 − 4 = 14 days

Inclusive calculation:

14 + 1 = 15 days

There are 14 elapsed days or 15 calendar dates when both endpoints are included.

Example 2: Dates in Different Months

Start date: July 25
End date: August 10

Days remaining in July after July 25:

31 − 25 = 6 days

Days in August up to August 10:

10 days

Total elapsed days:

6 + 10 = 16 days

Inclusive total:

16 + 1 = 17 days

Example 3: Dates in Different Years

Start date: December 20
End date: January 10

Days remaining in December after December 20:

31 − 20 = 11 days

Days in January up to January 10:

10 days

Total elapsed days:

11 + 10 = 21 days

Inclusive total:

21 + 1 = 22 days

Example 4: Consecutive Dates

Start date: September 12
End date: September 13

Elapsed difference:

13 − 12 = 1 day

Inclusive count:

1 + 1 = 2 calendar dates

This example explains why two people may get different answers while using the same date range.

How Month Length Affects Date Calculations

Each month has a different number of days:

  • January: 31 days
  • February: 28 or 29 days
  • March: 31 days
  • April: 30 days
  • May: 31 days
  • June: 30 days
  • July: 31 days
  • August: 31 days
  • September: 30 days
  • October: 31 days
  • November: 30 days
  • December: 31 days

When dates fall in different months, you must use the correct length of every month covered by the period.

For example, calculating from January 25 to March 5 requires you to consider:

  • The remaining days in January
  • All days in February
  • The first five days of March

A calculator handles these month-length differences automatically, which reduces the risk of manual counting errors.

How Leap Years Affect the Date Difference

A standard year has 365 days. A leap year has 366 days because February contains 29 days instead of 28.

Under the Gregorian calendar, a year divisible by four is usually a leap year. However, years divisible by 100 are not leap years unless they are also divisible by 400. For example, 2000 was a leap year, but 1900 and 2100 are not.

Examples of leap years include:

  • 2024
  • 2028
  • 2032
  • 2036

If a selected date range crosses February 29, that extra day must be included.

For example:

Start date: February 28, 2028
End date: March 1, 2028

Elapsed days:

  • February 29
  • March 1

Result:

2 days

For the same dates in a non-leap year, the elapsed difference would be one day.

How to Calculate Days Between Dates in Excel

Microsoft Excel stores valid dates as serial values, which allows one date to be subtracted from another.

Suppose:

  • Start date is entered in cell A2
  • End date is entered in cell B2

Use this formula:

=B2-A2

The result shows the elapsed number of days.

You can also use Excel’s DAYS function:

=DAYS(B2,A2)

The end date appears first in the DAYS formula, followed by the start date. Microsoft describes this function as returning the number of days between two dates.

To include both dates, add one:

=B2-A2+1

Or:

=DAYS(B2,A2)+1

Make sure:

  • Both cells contain valid dates
  • The start date comes before the end date
  • The result cell is formatted as a number rather than a date

If the result appears as another date, change the result cell format to General or Number.

How to Calculate Days Between Dates in Google Sheets

Google Sheets also allows you to subtract one valid date from another.

If the start date is in A2 and the end date is in B2, use:

=B2-A2

You can also use:

=DAYS(B2,A2)

Another useful formula is:

=DATEDIF(A2,B2,”D”)

The letter D tells the spreadsheet to return the difference in complete days.

For inclusive counting, add one:

=DATEDIF(A2,B2,”D”)+1

Check that:

  • A2 contains the earlier date
  • B2 contains the later date
  • Both values are recognized as dates
  • The result cell is formatted as a number

Using written month names can also help prevent confusion between date formats.

Calendar Days vs Working Days

Calendar days include every date within the selected period:

  • Weekdays
  • Saturdays
  • Sundays
  • Public holidays

Working days normally include the days on which a person or business operates. In many countries and workplaces, that means Monday through Friday, excluding weekends and selected public holidays.

For example, a period may contain 14 calendar days but only 10 standard working days.

Use a Days Between Dates Calculator when you need the complete calendar duration.

Use the working days calculator when weekends or holidays must be removed from the result.

You can also read our guide on how to calculate working days between two dates to learn more about business-day counting.

Days Between Dates vs Adding Days to a Date

These two calculations are related, but they answer different questions.

A days-between calculation asks:

How much time passes between these two dates?

For example:

  • Start date: May 1
  • End date: May 20
  • Result: 19 elapsed days

An add-days calculation asks:

What date will it be after a certain number of days?

For example:

  • Starting date: May 1
  • Add: 19 days
  • Result: May 20

Use a date-difference tool when both dates are already known. Use an add-or-subtract date calculator when you know one date and the number of days you want to move forward or backward.

When Is a Date Difference Calculation Useful?

Knowing how many days between two dates can help with many everyday and professional tasks.

Project Planning

Project managers can measure the time available between a starting date and a deadline. This makes it easier to divide work into stages and track progress.

Event Planning

Event organizers can check how many days remain before a wedding, conference, birthday, exhibition, or public event.

Delivery Tracking

Businesses and customers can compare order dates, dispatch dates, estimated delivery dates, and actual arrival dates.

Travel Planning

Travelers can calculate the length of a holiday, hotel booking, car rental, visa period, or international trip.

Subscription Management

You can measure the duration of a free trial, service contract, insurance period, or membership.

Financial Planning

Date calculations can help track billing cycles, payment deadlines, loan periods, and interest calculations.

Employee Records

Businesses may need to calculate employment durations, leave periods, training schedules, probation periods, or notice periods.

Personal Milestones

You can calculate the time between birthdays, anniversaries, appointments, exams, or other important dates.

Common Date Calculation Mistakes

Even a small mistake can change the final result.

Including the Start Date Without Realizing It

Standard date subtraction normally treats the start date as the starting point rather than the first completed day.

Add one only when you intentionally want an inclusive result.

Forgetting About Leap Years

A date range that crosses February 29 contains an extra calendar day.

Assuming Every Month Has 30 Days

Months may contain 28, 29, 30, or 31 days. Using 30 days for every month can produce an incorrect answer.

Confusing Calendar Days With Working Days

Calendar days include weekends and public holidays. Working days may exclude them.

Entering the Dates in Reverse Order

Placing the later date first may create a negative result or an error.

Using an Ambiguous Date Format

A date such as 04/08/2026 may mean April 8 or August 4, depending on the regional format.

Writing the month name makes the date clearer:

August 4, 2026

Ignoring Inclusive or Exclusive Settings

Two calculators may show different results because one includes the start date while the other does not.

Review the calculator settings before deciding that either result is wrong.

Frequently Asked Questions

How do I calculate the number of days between two dates?

Subtract the earlier date from the later date. This gives you the elapsed number of days. Add one when you need to include both the starting date and the ending date.

Should the start date be included?

It depends on the purpose of the calculation. Standard subtraction usually excludes the start date. Inclusive counting adds one so that both dates are part of the final total.

Are weekends included in a date difference?

Yes. A standard calendar-day calculation includes Saturdays, Sundays, and public holidays. Use a working days calculator when you need to exclude non-working days.

How do I calculate days between dates in Excel?

Enter the start date in one cell and the end date in another. Subtract the start-date cell from the end-date cell, or use the DAYS function.

Can I calculate dates from different years?

Yes. A date calculator can measure periods across different months and years. It also accounts for month lengths and leap years.

Why do two calculators show different answers?

The calculators may use different inclusive or exclusive settings. One may count the starting date, while the other only measures the elapsed time after it.

How many days are between two consecutive dates?

There is one elapsed day between two consecutive dates. If both dates are counted inclusively, the total is two calendar dates.

Does the calculation include public holidays?

A standard calendar-day calculation includes public holidays. Holidays are removed only when you use a working-day calculation and select the appropriate holiday settings.

Calculate Your Date Difference Instantly

Select your start and end dates and get the exact number of days within seconds.

Similar Posts