How to count days between two dates, and why answers differ by one

Subtract the earlier date from the later one. Whether you then add 1 depends on whether the last day counts, and that one day is behind most disagreements.

Published by Sumit Teli

Pick two dates in the date calculator to get the days between them, with or without the end date, in weekdays, weeks or months.

Count the days

The basic rule: subtract the dates

The number of days between two dates is the later date minus the earlier one. From March 3 to March 10 is 10 − 3 = 7 days. This counts the start date but not the end date, or, put another way, it counts the jumps from one day to the next. It's called exclusive counting, and it's what most calculators, spreadsheets and programming languages give you by default.

Days between = end date − start date

A good way to check it: the days between today and tomorrow is 1, and the days between a date and itself is 0. If your method gives 2 and 1 for those, it is counting inclusively.

Inclusive or exclusive: which one you need

Inclusive counting counts both the first and the last day, so it is always one more than the subtraction. March 3 to March 10 inclusive is 8 days. Neither way is wrong; they answer different questions.

QuestionCountExample
How many nights is my hotel stay?ExclusiveCheck in Dec 7, out Dec 11: 4 nights
How many days of leave am I taking?InclusiveMonday Dec 7 to Friday Dec 11: 5 days
How many days until my trip?ExclusiveFrom Oct 11 to Oct 18: 7 days
How many days did the festival run?InclusiveAug 1 to Aug 3: 3 days
How old is this invoice?ExclusiveIssued Sep 1, today Oct 1: 30 days
Take a tablet for 7 days, starting todayInclusiveToday is day 1, so the last dose is 6 days from today

The quick test is whether the end date itself is used up. A hotel night belongs to the evening you arrive, so the checkout day isn't a night. A day of leave on Friday is a day you're off, so Friday counts.

Counting across months by hand

When the two dates are in different months, split the count into three parts:

  1. Days left in the first month. Take the start day from the length of its month. October has 31 days, so from October 11 there are 31 − 11 = 20 days left.
  2. Add every full month in between. November has 30 days.
  3. Add the day number of the end date. For December 25, add 25.

October 11 to December 25: 20 + 30 + 25 = 75 days

That is exclusive. For inclusive, add 1: 76 days. Remember February: it has 29 days in a leap year, which is any year divisible by 4, except century years not divisible by 400. February 1 to March 1 is 28 days in 2027 and 29 days in 2028.

For a whole year, January 1 to December 31 is 364 days exclusive and 365 inclusive in a normal year. January 1 to the next January 1 is 365, or 366 when the year has a February 29.

Why two people get answers that differ by one

If you and someone else count the same dates and get, say, 75 and 76, you almost certainly agree on the dates and differ on whether the end date counts. This is the old fencepost problem: a fence with 10 posts has 9 gaps. Counting days on a calendar counts the posts; subtracting dates counts the gaps.

The same split shows up in everyday wording:

  • “From Monday to Friday” is 4 days apart but 5 working days. People usually mean 5 when talking about a working week and 4 when asking how long until Friday.
  • “In 3 days” on a Monday means Thursday: count Tuesday, Wednesday, Thursday.
  • “Day 1” in a plan, a challenge or a course is the first day itself, so day 30 is 29 days after day 1.

When it matters, such as for a deadline or a contract, write the end date down instead of a number of days, or say “up to and including” the date.

Days until a date, and why a countdown can show one less

“How many days until Christmas” is exclusive: today isn't counted and Christmas Day is. On December 24 there is 1 day to go. Children counting “sleeps” get the same number, because each night before the day is one sleep.

A live countdown clock can show one day fewer. At 3 pm, a date two days away is only 1 day and 9 hours away in real time, because the clock counts to midnight at the start of the day, not to the end of today. The Christmas countdown shows both: the calendar days and the clock. For your own date and time, use the countdown to a date.

In Excel or Google Sheets

With the start date in A1 and the end date in B1, any of these gives the exclusive count:

FormulaWhat it does
=B1-A1Subtracts the dates. Format the cell as a number, not a date.
=DAYS(B1, A1)The same, with the end date first.
=DATEDIF(A1, B1, "d")The same, and errors if the start is after the end.
=B1-A1+1Inclusive: counts both dates.
=NETWORKDAYS(A1, B1)Monday to Friday days, counting both dates.

Note that NETWORKDAYS counts inclusively while the subtraction doesn't, so mixing them in one sheet gives the one-day difference again. For Monday-to-Friday counts with the start date left out, subtract 1 when the start date is a weekday.

Common mistakes

  • Treating every month as 30 days. Months run from 28 to 31 days, so “30 days” and “1 month” are different. From January 31, one month later is the end of February, but 30 days later is in March.
  • Forgetting February 29. Any range that crosses the end of February in a leap year is one day longer.
  • Using timestamps in code. Dividing the milliseconds between two local midnights by 86,400,000 gives 6.96 instead of 7 across a clock change, and rounding down then loses a day. Count calendar dates, or round to the nearest whole day.
  • Counting on your fingers from the start date. Saying “3rd, 4th, 5th” for March 3 to 5 counts 3, which is the inclusive count. Subtract to get 2.
  • Not saying which count you mean. If a rule says “within 10 days”, check whether the first day counts and whether weekends do. The guide to business days and calendar days covers deadlines.