How to Calculate Days Between Dates – Methods & Formulas

Calculating the exact number of days between two dates is fundamental to project management, legal deadlines, financial planning, and everyday life. This guide covers three proven methods — manual month-by-month counting, the mathematical formula approach, and the Julian Day Number system — so you can verify results or work without a calculator. For instant answers, use our free date calculator.

Key Takeaways
  • Manual method: Count remaining days in the start month, add full months, then add days in the final month
  • Julian Day Number: Convert both dates to a single integer and subtract for an exact day count
  • Inclusive vs. exclusive: Decide whether to count the end date — this changes your total by 1
  • Month lengths vary: 28, 29, 30, or 31 days depending on the month and leap year status
  • Leap years: Add 1 day when the span crosses a February 29

Method 1: Manual Month-by-Month Counting

This is the most intuitive approach and works well for dates within the same year or spanning a few months.

  1. Count remaining days in the start month. Subtract the start day from the month's total days.
  2. Add the full days of each intermediate month.
  3. Add the day number of the end date.

Month Lengths Reference

MonthDaysMonthDays
January31July31
February28 / 29August31
March31September30
April30October31
May31November30
June30December31

Worked Example: March 10 to July 25, 2026

StepPeriodDaysRunning Total
1Mar 10 → Mar 312121
2April3051
3May3182
4June30112
5Jul 1 → Jul 2525137

Result: 137 days between March 10 and July 25, 2026 (exclusive counting).

Method 2: The Formula Approach

For dates within the same year, you can use the day-of-year numbers. Each date can be expressed as a number from 1 (January 1) to 365 or 366 (December 31).

Days Between = DayOfYear(End) − DayOfYear(Start)

Day-of-Year Cumulative Table (Non-Leap Year)

Month StartDay-of-YearMonth StartDay-of-Year
Jan 11Jul 1182
Feb 132Aug 1213
Mar 160Sep 1244
Apr 191Oct 1274
May 1121Nov 1305
Jun 1152Dec 1335

For the example above: July 25 is day 206, March 10 is day 69. Result: 206 − 69 = 137 days. In a leap year, add 1 to every day-of-year value after February 28.

Method 3: Julian Day Number

The Julian Day Number (JDN) is an astronomical system that assigns a unique integer to every calendar day. It eliminates all month-length and leap-year complications.

JDN = 367*Y − INT(7*(Y + INT((M+9)/12))/4) + INT(275*M/9) + D + 1721013.5

Where Y = year, M = month, D = day. To find days between two dates, compute JDN for each and subtract:

Days = JDN(End Date) − JDN(Start Date)

This method works across any range of dates, including multi-year spans and dates in different centuries.

Inclusive vs. Exclusive Counting

One of the most common sources of confusion is whether the end date should be counted:

Counting MethodExample (Jan 1 to Jan 5)ResultWhen Used
Exclusive (standard)Jan 2, 3, 4, 54 daysMost calculators, programming
Inclusive (both ends)Jan 1, 2, 3, 4, 55 daysLegal deadlines, hotel stays
Inclusive start onlyJan 1, 2, 3, 44 daysAge calculation, duration

When in doubt, our date calculator shows both inclusive and exclusive results.

Common Date Pairs Reference

Here are frequently searched date ranges for quick reference:

FromToDaysWeeks + Days
Jan 1, 2026Mar 31, 20268912 weeks, 5 days
Jan 1, 2026Jun 30, 202618025 weeks, 5 days
Jan 1, 2026Dec 31, 202636452 weeks
Feb 4, 2026May 5, 20269012 weeks, 6 days
Sep 1, 2026Dec 31, 202612117 weeks, 2 days
Jan 1, 2026Jan 1, 202736552 weeks, 1 day

Frequently Asked Questions

Simply subtract one date cell from another. If A1 contains the start date and B1 the end date, use =B1-A1. Excel stores dates as serial numbers, so subtraction gives you the exact day count. Use =DATEDIF(A1,B1,"d") for an alternative approach.

It depends on context. For measuring elapsed time, use exclusive counting (don't count the start date). For counting the number of dates in a range (like hotel nights), inclusive counting is standard. Legal deadlines vary by jurisdiction — always check the specific rule.

The Julian Day Number is a continuous count of days since January 1, 4713 BC. It is used in astronomy and computer science to simplify date arithmetic. By converting any date to its JDN, you can find the days between two dates by simple subtraction.

In a non-leap year there are 364 days between January 1 and December 31 (exclusive). In a leap year there are 365 days. Including both end dates, the totals are 365 and 366 respectively.

Leap years add one day (February 29), so any date range that spans across February 28-29 of a leap year will have one additional day compared to the same range in a non-leap year. The JDN method automatically handles this. For manual counting, just remember February has 29 days in leap years.

Yes. For the manual method, count the remaining days in the start year, add 365 (or 366 for leap years) for each full year in between, then add the day-of-year for the end date. The Julian Day Number method works across any number of years with a single subtraction.

Related Guides