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.
- 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.
- Count remaining days in the start month. Subtract the start day from the month's total days.
- Add the full days of each intermediate month.
- Add the day number of the end date.
Month Lengths Reference
| Month | Days | Month | Days |
|---|---|---|---|
| January | 31 | July | 31 |
| February | 28 / 29 | August | 31 |
| March | 31 | September | 30 |
| April | 30 | October | 31 |
| May | 31 | November | 30 |
| June | 30 | December | 31 |
Worked Example: March 10 to July 25, 2026
| Step | Period | Days | Running Total |
|---|---|---|---|
| 1 | Mar 10 → Mar 31 | 21 | 21 |
| 2 | April | 30 | 51 |
| 3 | May | 31 | 82 |
| 4 | June | 30 | 112 |
| 5 | Jul 1 → Jul 25 | 25 | 137 |
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).
Day-of-Year Cumulative Table (Non-Leap Year)
| Month Start | Day-of-Year | Month Start | Day-of-Year |
|---|---|---|---|
| Jan 1 | 1 | Jul 1 | 182 |
| Feb 1 | 32 | Aug 1 | 213 |
| Mar 1 | 60 | Sep 1 | 244 |
| Apr 1 | 91 | Oct 1 | 274 |
| May 1 | 121 | Nov 1 | 305 |
| Jun 1 | 152 | Dec 1 | 335 |
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.
Where Y = year, M = month, D = day. To find days between two dates, compute JDN for each and subtract:
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 Method | Example (Jan 1 to Jan 5) | Result | When Used |
|---|---|---|---|
| Exclusive (standard) | Jan 2, 3, 4, 5 | 4 days | Most calculators, programming |
| Inclusive (both ends) | Jan 1, 2, 3, 4, 5 | 5 days | Legal deadlines, hotel stays |
| Inclusive start only | Jan 1, 2, 3, 4 | 4 days | Age 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:
| From | To | Days | Weeks + Days |
|---|---|---|---|
| Jan 1, 2026 | Mar 31, 2026 | 89 | 12 weeks, 5 days |
| Jan 1, 2026 | Jun 30, 2026 | 180 | 25 weeks, 5 days |
| Jan 1, 2026 | Dec 31, 2026 | 364 | 52 weeks |
| Feb 4, 2026 | May 5, 2026 | 90 | 12 weeks, 6 days |
| Sep 1, 2026 | Dec 31, 2026 | 121 | 17 weeks, 2 days |
| Jan 1, 2026 | Jan 1, 2027 | 365 | 52 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.