ToolsVortex
Explore tools

How to Calculate Days Between Dates by Hand, in Excel and Online

How to Calculate Days Between Dates by Hand, in Excel and Online
Date & TimeUpdated November 14, 20269 min readBy ToolsVortex Editorial Team

To calculate days between dates, turn each date into its day of the year and subtract the smaller number from the larger. October 22, 2026 is day 295 and December 25 is day 359, so the gap is 64 days. Add 1 if you count both the start and end day, which gives 65 days.

64 daysOct 22 to Dec 25, 2026 (65 counting both)
+1the rule for inclusive counts
366 daysin leap years like 2028
How to Calculate Days Between Dates by Hand, in Excel and Online

If you want to know how to calculate days between dates, the core idea is simple: give each date a number, then subtract. The tricky parts are deciding whether the first and last days count, and catching February 29 in a leap year.

This guide shows a day of year chart you can use by hand, the inclusive vs exclusive rule, how courts count deadlines, and the Excel formulas that do the same job. For a quick answer, our days between dates calculator does it in one click.

How Do You Calculate the Number of Days Between Two Dates?

You find the number of days between two dates by converting each date to a day count and subtracting the earlier count from the later one.

Within one year, the easiest count is the day of the year. January 1 is day 1 and December 31 is day 365 (or 366 in a leap year).

Same year = day of year (end) minus day of year (start)
Day of year = first day number of the month (from the chart) + day of month minus 1
Inclusive count = result + 1

Example: October 1 is day 274 in a common year, so October 22 is 274 + 22 minus 1 = day 295. December 1 is day 335, so December 25 is day 359. Then 359 minus 295 = 64 days.

When the dates are in different years

Split the range at New Year. Count the days left in the first year, then add the day of year of the end date.

  • November 20, 2026 is day 324. Days left in 2026: 365 minus 324 = 41.
  • March 5, 2027 is day 64.
  • Total: 41 + 64 = 105 days.

For spans of many years, add 365 for each full common year and 366 for each leap year in between.

Days Between Dates CalculatorPick a start date and an end date to count the exact number of days between them.
Open tool →

What Day of the Year Does Each Month Start On?

Each month starts on a fixed day number, and in a leap year every month from March on starts one day later.

MonthDays in monthDay 1 is day of year (common year)Day 1 is day of year (leap year)
January3111
February28 or 293232
March316061
April309192
May31121122
June30152153
July31182183
August31213214
September30244245
October31274275
November30305306
December31335336

Day of year = the chart number + day of month minus 1. July 4 in a common year is 182 + 4 minus 1 = day 185.

Print this chart or save it on your phone. With it, any same year gap takes two lookups and one subtraction. If you also need to know which weekday a date lands on, use the day of the week calculator.

Should You Count Both the Start and End Date?

Plain subtraction counts one end but not the other, so add 1 only when both the first and last day should count.

Think of a hotel stay. Check in Monday, check out Wednesday: that is 2 nights (exclusive count) but 3 calendar days you are there (inclusive count). Both answers are right. They answer different questions.

RangeSubtraction (one end)Inclusive (both ends)Typical use
Jun 22 to Jul 6, 20261415Camp session, both days attended
Oct 22 to Dec 25, 20266465Countdown to a holiday
Feb 1 to Mar 1, 20262829Billing period
Feb 1 to Mar 1, 20282930Same period, leap year
Jan 1 to Dec 31, 2026364365Full calendar year

If a countdown says “64 days until Christmas,” it uses subtraction. If a program says “15 day camp,” it counts both ends.

How courts count deadlines

Federal courts use a fixed rule. Under Federal Rule of Civil Procedure 6(a), you exclude the day of the event that starts the clock, count every day after it including weekends and holidays, and include the last day. If the last day is a Saturday, Sunday or legal holiday, the deadline moves to the next day that is not one. So 30 days from Friday, October 2, 2026 lands on Sunday, November 1, and the deadline rolls to Monday, November 2. State courts and contracts can use different rules, so always check the one that applies to you.

How Do Leap Years Affect the Days Between Dates?

A leap year adds February 29, so any range that crosses that date is one day longer than the same range in a common year.

The US Naval Observatory states the Gregorian rule this way: a year divisible by 4 is a leap year, except century years, which must also be divisible by 400. That makes the average year 365.2425 days long.

YearDivisible by 4?Century year?Divisible by 400?Leap year?Days
1900YesYesNoNo365
2000YesYesYesYes366
2026NoNoNoNo365
2028YesNoNoYes366
2100YesYesNoNo365

The leap day only matters if February 29 sits inside your range. January 5 to February 20 is the same length every year. February 20 to March 5 is one day longer in 2028 than in 2026. When you add whole years, count how many February 29s you pass. This is also why a birthday count in days changes from year to year, which our age calculator handles for you.

How Many Days Are Between February 10 and July 4, 2028?

There are 145 days between February 10 and July 4, 2028, or 146 if you count both days.

Worked example

Sam is saving for a July 4, 2028 trip and starts on February 10, 2028. Sam wants to know how many days there are to save, and how much to set aside per week.

  1. Check the year: 2028 is divisible by 4 and is not a century year, so it is a leap year. Use the leap year column.
  2. February 10: February starts on day 32, so 32 + 10 minus 1 = day 41.
  3. July 4: July starts on day 183 in a leap year, so 183 + 4 minus 1 = day 186.
  4. Days between: 186 minus 41 = 145 days.
  5. In weeks: 145 / 7 = 20 weeks and 5 days, or about 20.7 weeks.
  6. To save $1,200: $1,200 / 20.7 = about $58 a week.

If Sam had used the common year column, July 4 would be day 185 and the answer would be 144, one day short. The leap year check is the step people skip most.

To see how many of those 145 days are weekdays, count weekends separately. That range holds 103 weekdays. Our guide on how many work days are in a year shows how federal holidays cut that number further.

How Do You Calculate Days Between Dates in Excel?

In Excel, subtract one date cell from the other, or use DAYS with the end date first.

Microsoft says Excel stores dates as serial numbers, with January 1, 1900 as serial number 1. Because each date is a number, subtraction works directly.

  • =B2-A2 gives the days between the date in A2 and the date in B2.
  • =DAYS(B2,A2) does the same. Note the order: end date, then start date. Microsoft’s own example, =DAYS("15-MAR-2021","1-FEB-2021"), returns 42.
  • =B2-A2+1 gives the inclusive count.
  • NETWORKDAYS counts only workdays, and DAYS360 uses a 360 day year that some accounting systems use, so it will not match a calendar count.

The 1900 leap year quirk

Microsoft confirms that Excel treats 1900 as a leap year, even though it was not. It kept this to stay compatible with Lotus 1-2-3. It only affects dates before March 1, 1900, so modern ranges are fine. If you work with historical records, check old dates another way. You can also add a number of days to a start date with the date calculator, or jump straight to a common target with the 90 days from today calculator.

Once you know the method, you can check any tool’s answer by hand. For everyday use, the days between dates calculator is faster and handles leap years for you.

Quick Recap

  • Convert each date to its day of the year, then subtract.
  • Add 1 only when both the start and end day should count.
  • Leap years add February 29, so check the year before using the chart.
  • Federal court deadlines exclude the trigger day and roll past weekends and holidays.
  • In Excel, use =B2-A2 or =DAYS(end, start).
How to Calculate Days Between Dates by Hand, in Excel and Online: use the free days between dates calculator on ToolsVortex

Frequently Asked Questions

How many days are between two dates if I include both days?

Subtract the earlier date from the later one, then add 1. From June 22 to July 6, 2026 is 14 days by subtraction and 15 days if you count both June 22 and July 6.

What day of the year is today, October 22, 2026?

October 22, 2026 is day 295 of 365. October starts on day 274 in a common year, so 274 + 22 minus 1 = 295. That leaves 70 days until the end of the year.

Is 2028 a leap year?

Yes. 2028 is divisible by 4 and is not a century year, so it has 366 days and a February 29. The next century year, 2100, will not be a leap year because it is not divisible by 400.

How do I count days between dates in different years?

Count the days left in the first year, add 365 or 366 for each full year in between, then add the day of year of the end date. November 20, 2026 to March 5, 2027 is 41 + 64 = 105 days.

Does a 30 day deadline include weekends?

Under Federal Rule of Civil Procedure 6(a), yes. You count every day, including weekends and holidays, but if the last day falls on one, the deadline moves to the next business day. Other rules and contracts may differ.

Why does Excel’s DAYS function need the end date first?

Its syntax is DAYS(end_date, start_date). If you reverse them, you get a negative number of the same size. Plain subtraction, end cell minus start cell, gives the same result as DAYS.

How do I turn days into weeks?

Divide by 7. The whole number is full weeks and the remainder is extra days. 145 days is 20 weeks and 5 days, because 20 x 7 = 140 and 145 minus 140 = 5.

Sources

  1. US Naval Observatory: Leap Years, Gregorian leap year rule and 365.2425 day average year
  2. Cornell Law School LII: Federal Rule of Civil Procedure 6, how federal deadlines count days and roll past weekends
  3. Microsoft Support: DAYS function, DAYS syntax, example and Excel date serial numbers
  4. Microsoft Support: Excel incorrectly assumes that the year 1900 is a leap year, the 1900 leap year quirk and Lotus 1-2-3 compatibility
TV
Written by the ToolsVortex Editorial Team

We check every number in our guides against the original source and test each example in our calculators before publishing. This guide is general information, not professional advice. Spotted an error? Tell us and we will fix it.

Keep reading