English

How to Calculate Days Between Dates: By Hand and in a Spreadsheet

A wall calendar with two dates circled and a ribbon counting the days between them

Quick Answer

To calculate days between dates, count every day after the start date up to and including the end date. From March 5 to May 20, 2026, that is 76 days: 26 left in March, 30 in April and 20 in May. This guide shows the hand method, the spreadsheet formulas, and the leap-year and "include the end date" rules that change the answer.

On this page
  1. What does "days between two dates" actually count?
  2. How do you count days between dates by hand?
  3. How do month lengths and leap years change the answer?
  4. How do you calculate days between dates in a spreadsheet?
  5. Should you include the end date?
  6. What is the quickest way to check my answer?
  7. Frequently Asked Questions
  8. Our Take
  9. Sources

Key Takeaways

  • Counting from the start date, the first day you count is the next day. January 1 to January 2 is 1 day, not 2.
  • By hand: days left in the start month, plus the full months in between, plus the day number of the end date.
  • February has 28 days, or 29 in a leap year, so a range that crosses February can differ by one day from year to year.
  • In a spreadsheet, subtract the earlier date from the later one, or use DAYS with the end date first.
  • Whether to add 1 for the end date depends on the question you are answering, so decide that before you count.

What does "days between two dates" actually count?

Think of a calendar as a row of squares. The number of days between two dates is the number of steps you take to walk from one square to the other. Standing on January 1 and stepping to January 2 is one step, so the answer is 1.

That means the start date is not counted. Our calculator counts every day after the start date up to the end date, so January 1 to January 2 is 1 day. This is the same "end minus start" arithmetic a spreadsheet does, which is why the two usually agree.

Sometimes you want the other kind of count: how many calendar days does an event touch, if both the first and last day are included? Then you add 1. January 1 to January 2 touches 2 days. The difference matters for questions like "how many days is this three-night hotel stay?" Three nights, March 5 to March 8, 2026, is 3 days by the step count and 4 calendar days if you include both ends (a hypothetical example).

Exclusive and inclusive counting compared Two rows of day boxes for January 1 and January 2. In the first row only January 2 is counted, giving 1 day. In the second row both boxes are counted, giving 2 days. Start date not counted (our tool) Jan 1 start, skipped Jan 2 counted: 1 = 1 day Include the end date, start also counted Jan 1 counted: 1 Jan 2 counted: 2 = 2 days Computed with CalcLesson date.mjs: 1 and 2
Same two dates, two counting rules. Decide which one your question needs before you count.

How do you count days between dates by hand?

The hand method splits the range at month boundaries, so you never count one day at a time. It has three parts:

  1. Days left in the start month. Subtract the start day from the number of days in that month.
  2. Full months in between. Add the length of every whole month you pass through.
  3. Days into the end month. Add the day number of the end date.

Here is a worked example from March 5, 2026 to May 20, 2026:

  • Days left in March: 31 minus 5 = 26
  • All of April: 30
  • Days into May: 20
  • Total: 26 + 30 + 20 = 76

Our calculator gives 76, and 77 if you include the end date. You can also express 76 days as 10 weeks and 6 days, because 10 times 7 is 70.

Counting 76 days from March 5 to May 20, 2026 A timeline bar split into three pieces that grow in turn: 26 days left in March, 30 days of April and 20 days into May, adding up to 76 days. Mar 5 to May 20, 2026 26 30 20 left in March all of April into May Mar 5 May 20 26 + 30 + 20 = 76 days
The hand method as a bar: each piece is one month's share of the range, and the pieces add up to 76 days.

A quick way to check your work is to count backward. May 20 to March 5 is minus 76 days on our calculator, which shows a negative count when the start date is later. If the sign flips and the size matches, your arithmetic is probably right.

How do month lengths and leap years change the answer?

The hand method only works if you know how long each month is. Most months have 30 or 31 days, and February is the odd one out. The U.S. Naval Observatory states the Gregorian rule: every year exactly divisible by four is a leap year, except centurial years, which are leap years only if they are exactly divisible by 400 [1]. So 2028 and 2000 are leap years, while 2026 and 1900 are not. The reason for the extra day is that, as NASA explains, Earth takes approximately 365.25 days to orbit the Sun, while a calendar year is usually rounded to 365 [2].

MonthDays in 2026Days in 2028 (leap year)
January3131
February2829
March3131
April3030
May3131
June3030
July3131
August3131
September3030
October3131
November3030
December3131
Whole year365366
Length of each month in a common year A bar chart of the twelve months in 2026. Seven months have 31 days, four have 30 days and February has 28 days, shown in pink. Days in each month, 2026 31Jan 28Feb 31Mar 30Apr 31May 30Jun 31Jul 31Aug 30Sep 31Oct 30Nov 31Dec Pink: February. In a leap year it is 29.
Seven long months, four medium months and one short one. The bars start at zero, so the small gaps are real.

Leap years show up in the answer only when the range crosses February 29. Compare these two ranges, both computed on our calculator:

  • January 1 to March 1, 2026 is 59 days. The same range in 2028 is 60 days.
  • December 15 to March 10 is 85 days from 2026 into 2027 (16 + 31 + 28 + 10), but 86 days from 2027 into 2028 (16 + 31 + 29 + 10).
  • A full year from January 1 to the next January 1 is 365 days in 2026 and 366 days in 2028.

When you do the hand method, Write down the length of February before you start counting, because it is the month people get wrong most often. If you are working with ages rather than plain day counts, the same calendar logic applies, and our guide on how age is calculated walks through it.

How do you calculate days between dates in a spreadsheet?

In a spreadsheet, subtracting the earlier date from the later one gives the day count directly. Put the start date in A1 and the end date in B1, then enter =B1-A1. Format the result cell as a number, because some programs show a date by default. This matches our rule: the start date is not counted.

Microsoft's DAYS function does the same job with one catch, the argument order. Its syntax is DAYS(end_date, start_date), and Microsoft describes it as returning the number of days between two dates [3]. Its own example, =DAYS("15-MAR-2021","1-FEB-2021"), returns 42. We checked that with our code: February 1 to March 15, 2021 is 42 days, so DAYS also leaves the start date out.

Two practical notes:

  • Microsoft says numeric dates are subtracted as end date minus start date, so swapping the two arguments flips the sign of the result.
  • If a date is entered as text, Microsoft says Excel converts it with DATEVALUE, and text that cannot be read as a date returns the #VALUE! error [3].

To include the end date, add 1: =B1-A1+1. For whole days only, Microsoft also documents the DATEDIF function with the "d" unit, which returns the number of full days between two dates [4]. Spreadsheet settings differ between programs, so test one range you already know, such as January 1 to January 2, before you trust a formula.

Should you include the end date?

There is no single correct answer, because the two counts answer two different questions. Use the step count when you ask "how long until" or "how long since," and the inclusive count when you ask how many calendar days a period covers.

QuestionCount to useExample (2026)
How many days until Christmas from November 24?Step count31
How many calendar days is a trip from March 5 to March 8?Inclusive4
How many nights is that same trip?Step count3
How long is the March 5 to May 20 span?Step count76
The same span, both ends countedInclusive77

For anything with a legal, contract or billing deadline, check how the rule or agreement counts days before you rely on any calculator, ours included. Different documents count differently, and some skip weekends. For weekdays only, use the business days calculator, and read business days vs calendar days to see how the two differ.

What is the quickest way to check my answer?

Run the numbers a second way. If your hand count says 76 days, you can confirm it three ways:

  1. Plug both dates into the days between dates calculator and compare.
  2. Convert to weeks: 76 divided by 7 is 10 weeks and 6 days. If both dates fall on a similar weekday, the remainder should be small. March 5, 2026 is a Thursday and May 20, 2026 is a Wednesday, and 6 days past 10 full weeks lands one weekday earlier, which fits. You can look up any date's weekday with the day of the week finder.
  3. Count the other direction, as described above, and confirm the same size with the opposite sign.

For a live countdown to a specific date, try the countdown tool, or jump straight to the days until Christmas page. If you want to know how our tools handle edge cases, the methodology page lists the counting rules in one place.

Frequently Asked Questions

Does the start date count when you calculate days between dates?

Not on our calculator. January 1 to January 2 is 1 day, because you count each day after the start date. If you want both ends counted, add 1 to the result.

How many days are there between two dates in different years?

Use the same method. Count the days left in the start year, add the days in any whole years between, then add the day number within the end year. Remember that a leap year has 366 days, and you can confirm any total with the days between dates calculator.

Why is my spreadsheet answer one day off from another calculator?

Usually one tool counts the end date and the other does not. =B1-A1 leaves the start date out, matching our tool. If another tool shows one more day, it is probably counting both ends.

Can I find the age difference between two people the same way?

Partly. Day counts work for any two dates, but people usually want years, months and days. For that, use the age difference calculator instead.

Our Take

We think the biggest mistake with date math is not arithmetic, it is skipping the question of whether the end date counts. Most wrong answers in problems like these come from mixing the step count and the inclusive count, not from a bad subtraction. So we count the steps, show the rule next to the result, and let you add 1 when your situation calls for it. The hand method is worth learning once, because it makes the answer feel checkable instead of magic. After that, let a tool do the repetitive work, and keep one known range in your head, such as March 5 to May 20 giving 76, as a quick test of whatever tool you use.

Sources

  1. Calendars FAQ. U.S. Naval Observatory.
  2. What Is a Leap Year?. NASA.
  3. DAYS function. Microsoft Support.
  4. Calculate the difference between two dates. Microsoft Support.

Calculations follow the rules explained on our methodology page. For legal deadlines, medical doses or engineering work, confirm with the responsible authority. Spotted an error? Tell us.