Why Count Days Between Dates?
Calculating the number of days between two dates is a surprisingly common task. It comes up in project management (how many days until a deadline?), finance (interest accrual periods), legal matters (contract durations), health tracking (pregnancy due dates, medication schedules), and everyday planning (how long until a vacation?).
The Simple Subtraction Method
At its core, counting days between dates is just subtraction — but dates need to be converted into a consistent numeric format first.
Step-by-Step: Manual Calculation
- Convert both dates to Julian Day Numbers (JDN) — A Julian Day Number is a continuous count of days from a fixed starting point, making date arithmetic simple.
- Subtract the earlier JDN from the later JDN — The result is the number of days between the two dates.
For most practical purposes, you won't need to calculate JDNs manually — spreadsheets, date calculators, and programming languages handle this automatically. But it's useful to understand the concept.
Using a Spreadsheet (Excel / Google Sheets)
Spreadsheets make this extremely easy:
- Enter your start date in cell A1 (e.g., 2025-01-01)
- Enter your end date in cell A2 (e.g., 2025-06-15)
- In cell A3, enter: =A2-A1
- Format cell A3 as a Number (not as a date), and you'll see the number of days.
Google Sheets also supports the DAYS(end_date, start_date) function for added clarity.
The DATEDIF Function
In Excel and Google Sheets, the DATEDIF function gives you more control:
=DATEDIF(A1, A2, "D")— returns the total number of days=DATEDIF(A1, A2, "M")— returns complete months=DATEDIF(A1, A2, "Y")— returns complete years
Handling Leap Years
Leap years add an extra day (February 29) every four years, with exceptions for century years. If your date range spans a February 29, your total will include that day automatically — as long as you're using a proper date subtraction method rather than simply multiplying by 365.
Leap year rule: A year is a leap year if it is divisible by 4, except for century years (divisible by 100), which must also be divisible by 400 to be a leap year. For example, 2000 was a leap year; 1900 was not.
Including or Excluding the Start/End Date
One common source of confusion is whether to count both the start and end dates or just one. The convention depends on context:
- Elapsed time (e.g., how many days has it been?) — typically count only the end date, not the start.
- Duration including both endpoints (e.g., "from January 1 to January 5, inclusive") — add 1 to the standard subtraction result.
- Business/legal contexts — always clarify whether the count is inclusive or exclusive to avoid disputes.
Working Days vs. Calendar Days
If you need to count only working days (excluding weekends and public holidays), the calculation is more involved. In Excel, use the NETWORKDAYS(start_date, end_date) function. For public holidays, you can pass a range of holiday dates as a third argument.
Quick Reference: Days in Each Month
| Month | Days (regular year) | Days (leap year) |
|---|---|---|
| January | 31 | 31 |
| February | 28 | 29 |
| March | 31 | 31 |
| April | 30 | 30 |
| May | 31 | 31 |
| June | 30 | 30 |
| July | 31 | 31 |
| August | 31 | 31 |
| September | 30 | 30 |
| October | 31 | 31 |
| November | 30 | 30 |
| December | 31 | 31 |
Summary
Counting days between dates is simple with the right tools. Use a spreadsheet for precision, be mindful of leap years, and clarify whether your count should include both endpoints. For recurring needs, a dedicated online date calculator can save time and reduce errors.