How to Calculate the Number of Days Between Two Dates (and N Days From a Date)
“How many days are there from April 1 to October 21?” “What day of the week is it 100 days from today?” “If something is due within 30 days of a contract, when is the deadline?” Counting days looks like a single subtraction, but whether you include the first day shifts the answer by one, and miscounting the length of a month or a leap year can shift it by another day or two. This guide covers the basic formula for the days between two dates, when to count one end or both ends (excluding or including the first day), how to count across months, a day-of-year chart, how to find the date and weekday N days before or after, why “one month” is not the same as “30 days”, and the Excel and Google Sheets formulas, all checked against real dates.
The short answer: end date − start date, then ±1 depending on what you include
To find the number of days between two dates, subtract the start date from the end date. The result counts only one end, which is the same way “N days later”, “N days ago” and “N nights” are counted. To count both the start date and the end date, add 1; to count neither, subtract 1. Almost every mistake in day counting comes from choosing the wrong one of these three.
| Method | Formula | Example: November 1 to November 10 | Typical uses |
|---|---|---|---|
| Count one end only | End − start | 9 days | N days later / ago, days elapsed, hotel nights, legal periods (first day excluded) |
| Count both ends (inclusive) | End − start + 1 | 10 days | “From X to Y”, “for N days”, hospital stays, trip length, event periods |
| Exclude both ends (days in between) | End − start − 1 | 8 days | Days between two appointments, “how many days are free in between” |
The one-day difference is the classic fencepost problem. If you circle November 1 through November 10 on a calendar, you draw 10 circles, but there are only 9 gaps between them (the number of times the date changes). “N days later” counts the gaps; “N days long” counts the circles. Keep that picture in mind and you will rarely get it wrong.
When to count one end and when to count both (chart by situation)
Even for the same “10 days”, each situation has its own rule about whether the first day counts. Counting one end is also called “excluding the first day”, and counting from the first day is called “including the first day”. Here are the common cases, with the Japanese rules where they differ.
| Situation | Method | Example |
|---|---|---|
| N days later / N days ago | One end (base date is day 0) | 10 days after November 1 is November 11 |
| From X to Y / for N days | Both ends | November 1 to November 10 is 10 days |
| Hotel nights and trip length | Nights: one end. Days: both ends | August 10 to August 16 is 6 nights, 7 days |
| Legal periods in Japan (Civil Code Art. 140) | First day excluded (count from the next day) | Received on November 1, “within 10 days” → by November 11 |
| Cooling-off in Japan (door-to-door sales, etc.) | First day included (the day you receive the document is day 1) | Received on November 1 → by November 8 |
| Legal age in Japan (Act on Age Calculation) | First day included (counted from the day of birth) | You turn a year older at the end of the day before your birthday |
| Hospital stays (medical insurance, etc.) | Both ends (admission and discharge days) | A one-night stay counts as 2 days |
| Buddhist memorial days (7th, 49th day) | Day of death is day 1 | The 49th day is 48 days after the date of death |
| Japanese baby milestones (“day N after birth”) | Day of birth is day 1 | Okuizome (day 100) is 99 days after the birthday |
In Japanese law, Article 140 of the Civil Code says that when a period is set in days, weeks, months or years, the first day is not counted. If you are told on November 1 to reply “within 10 days”, counting starts on November 2, and the deadline is the end of the 10th day, November 11. The exception is a period that starts exactly at midnight (for example, one agreed in advance as “10 days starting November 1”), in which case the first day counts. Some laws, such as those on cooling-off and age, explicitly include the first day instead. Many other legal systems follow the same “exclude the first day” principle, but check the rules that apply to you.
Customs that make the date of death or the birthday day 1 come out one day earlier than a tool that shows elapsed days (base date = day 0). For anniversaries such as the day you started dating, see how to count anniversary days, which explains how to match each custom.
Counting across months, and the number of days in each month
Within a single month you just subtract the day numbers, but across months you need to add up how many days each month in between has. The lengths are below; only February changes, between 28 and 29 days depending on whether it is a leap year.
| Month | Days | Month | Days |
|---|---|---|---|
| January | 31 | July | 31 |
| February | 28 (29 in a leap year) | August | 31 |
| March | 31 | September | 30 |
| April | 30 | October | 31 |
| May | 31 | November | 30 |
| June | 30 | December | 31 |
The months without a 31st are February, April, June, September and November. English speakers remember them with the rhyme “Thirty days hath September, April, June and November”, or by counting on their knuckles: each knuckle is a 31-day month and each dip is a shorter one. In Japan the same five months are remembered with the pun “nishi muku samurai” (ni = 2, shi = 4, mu = 6, ku = 9, and samurai written with a character resembling 11).
- 1
Find the days left in the first month
To count from March 15 to June 30 (one end only), March contributes 31 − 15 = 16 days (March 16 to 31, not counting March 15).
- 2
Add the full months in between
Add April's 30 days and May's 31 days. That gives 16 + 30 + 31 = 77 days so far.
- 3
Add the day number in the last month
June runs up to the 30th, so add 30: 77 + 30 = 107 days. To count both ends (including March 15), add 1 for 108 days.
A leap year is a year divisible by 4 (with the exceptions that years divisible by 100 are common years and years divisible by 400 are leap years). The next leap year is 2028, and any period that contains February 29 is one day longer than the same period in a common year: February 1 to March 1 is 28 days in 2027 but 29 days in 2028. The exact rules are explained in how leap years are determined.
Day-of-year chart (which day of the year a date is)
To handle month boundaries in one step, use the day of the year, counting January 1 as day 1. Subtracting the day-of-year numbers of two dates gives the number of days between them (one end only). The chart shows the day of the year for the 1st of each month; for any other date, use “chart value + day − 1”.
| Month | 1st of the month (common year) | 1st of the month (leap year) | Last day of the month (common year) |
|---|---|---|---|
| January | 1 | 1 | 31 |
| February | 32 | 32 | 59 |
| March | 60 | 61 | 90 |
| April | 91 | 92 | 120 |
| May | 121 | 122 | 151 |
| June | 152 | 153 | 181 |
| July | 182 | 183 | 212 |
| August | 213 | 214 | 243 |
| September | 244 | 245 | 273 |
| October | 274 | 275 | 304 |
| November | 305 | 306 | 334 |
| December | 335 | 336 | 365 |
- Within one year: April 1, 2026 is day 91 and October 21 is day 274 + 21 − 1 = 294, so there are 294 − 91 = 203 days between them.
- Across a year boundary: from December 24, 2026 (day 358) to January 10, 2027, take the 365 − 358 = 7 days left in the year and add the 10 days of the new year, for 17 days.
- Days left in the year: from October 21 (day 294) to December 31 is 365 − 294 = 71 days; to New Year's Day it is 72 days.
- In a leap year every date from March onward is one higher, and the year has 366 days.
Finding the date N days later or earlier, with a chart
“N days later” means adding N days to the base date. The base date counts as day 0, so 1 day after November 1 is November 2 and 10 days after is November 11. When you pass the end of a month, subtract that month's length and carry over into the next month.
- 1
Add the number of days to the day of the month
For 45 days after November 1, 1 + 45 = 46. November only has 30 days, so the result is not in November.
- 2
Subtract the month's length and move to the next month
46 − 30 = 16, which gives December 16. If the number is still too large, keep subtracting December's 31 days, January's 31 days and so on.
- 3
For N days earlier, go the other way
For 30 days before November 1, 1 − 30 = −29. Add the 31 days of the previous month, October: −29 + 31 = 2, which gives October 2.
| Days | N days after Sunday, November 1, 2026 | Weekday | Roughly |
|---|---|---|---|
| 7 days | November 8 | Sun | One week later, same weekday |
| 10 days | November 11 | Wed | |
| 14 days | November 15 | Sun | Two weeks later |
| 30 days | December 1 | Tue | About 1 month |
| 45 days | December 16 | Wed | About 1.5 months |
| 60 days | December 31 | Thu | About 2 months |
| 90 days | January 30, 2027 | Sat | About 3 months |
| 100 days | February 9, 2027 | Tue | About 3 months and a week |
| 180 days | April 30, 2027 | Fri | About half a year |
| 200 days | May 20, 2027 | Thu | |
| 300 days | August 28, 2027 | Sat | About 10 months |
| 365 days | November 1, 2027 | Mon | One year later (across a common year) |
| 500 days | March 15, 2028 | Wed | About 1 year and 4 months |
| 1,000 days | July 28, 2029 | Sat | About 2 years and 9 months |
Going backward, 30 days before November 1, 2026 is Friday, October 2, and 100 days before is Friday, July 24. This is handy for planning backward from an exam or a departure date, such as “start preparing 100 days before”.
Working out the weekday N days later in your head (remainder after dividing by 7)
Weekdays repeat every 7 days, so you only need to move the weekday forward by the remainder after dividing the number of days by 7. Without flipping through a calendar, 100 days after a Sunday is “100 ÷ 7 = 14 remainder 2”: two days after Sunday, a Tuesday.
| Remainder after ÷ 7 | Weekday shift | Examples of day counts |
|---|---|---|
| 0 | Same weekday | 7, 14, 28, 70, 91, 364 days |
| 1 | 1 day forward | 15, 50, 120, 365 days |
| 2 | 2 days forward | 30, 100, 366 days |
| 3 | 3 days forward | 10, 45, 500 days |
| 4 | 4 days forward | 60, 200 days |
| 5 | 5 days forward | 180 days |
| 6 | 6 days forward (same as 1 day back) | 90, 300, 1,000 days |
- One common year later (365 days) the weekday moves forward by 1, and a year that crosses February 29 (366 days) moves it by 2. That is why your birthday falls one weekday later each year.
- For N days earlier, move backward instead. For 100 days before, the remainder is 2, so two days before Sunday is Friday.
- Thirty days later moves the weekday by 2, so an event held on the same date every month shifts by 2 weekdays after a 30-day month and by 3 after a 31-day month.
“One month later” is not “30 days later”: counting periods set in months or weeks
Periods set as “1 month”, “3 months” or “1 year” are counted by calendar date (the corresponding day), not by a number of days. Because a month is not always 30 days, converting to days first puts you off by 1 to 3 days depending on the month.
| Base date | 1 month later (by calendar) | 30 days later (by day count) | Difference |
|---|---|---|---|
| November 1, 2026 | December 1 | December 1 | None |
| December 1, 2026 | January 1, 2027 | December 31 | 1 day |
| January 31, 2027 | February 28 (no February 31, so the month end) | March 2 | 2 days |
| 3 months after November 1, 2026 | February 1, 2027 (92 days later) | 90 days later is January 30 | 2 days |
Article 143 of Japan's Civil Code says that periods set in weeks, months or years are counted by the calendar and end on the day before the day that corresponds to the starting day in the last week, month or year. If the last month has no corresponding day (counting from January 31 into February, for example), the period ends on the last day of that month. So for one month from November 15 with the first day excluded, counting starts on November 16 and the period ends on December 15, the day before December 16. When a contract or procedure says “within 1 month” or “within 3 months”, count by date, not by days.
| Days | In weeks | Rough months |
|---|---|---|
| 7 days | 1 week | About 0.2 months |
| 30 days | 4 weeks and 2 days | About 1 month |
| 60 days | 8 weeks and 4 days | About 2 months |
| 90 days | 12 weeks and 6 days | About 3 months |
| 100 days | 14 weeks and 2 days | About 3.3 months |
| 180 days | 25 weeks and 5 days | About 6 months |
| 365 days | 52 weeks and 1 day | About 12 months (1 year) |
The “about” figures divide by an average month of 30.44 days (365.25 ÷ 12). When you need an exact “X years, Y months, Z days”, a tool that counts date to date is more reliable. How age-style periods (“X years and Y months old”) are counted is covered in how age is counted.
Excel and Google Sheets formulas for counting days
Excel and Google Sheets store dates as running numbers called serial values (in Excel, January 1, 1900 is 1). That is why subtracting one date from another gives a number of days, and adding a number to a date gives the date N days later. With the start date in A2 and the end date in B2, the formulas are:
| What you want | Formula | Example result (A2 = 2026/4/1, B2 = 2026/10/21) |
|---|---|---|
| Days between (one end) | =B2-A2 | 203 |
| Days including both ends | =B2-A2+1 | 204 |
| Days, using a function | =DATEDIF(A2,B2,"D") | 203 |
| Complete months / years | =DATEDIF(A2,B2,"M"), =DATEDIF(A2,B2,"Y") | 6, 0 |
| Days from today | =B2-TODAY() | Depends on the day you open it |
| Date 100 days later | =A2+100 | 2026/7/10 |
| Date 1 month later (snaps to month end) | =EDATE(A2,1) | 2026/5/1 |
| Days excluding weekends (both ends) | =NETWORKDAYS(A2,B2,holiday_range) | Pass a holiday list to exclude holidays too |
| Date 3 business days later | =WORKDAY(A2,3,holiday_range) | The base date is not counted |
| Show the weekday | =TEXT(A2,"ddd") | Wed |
- If a subtraction shows up as a date such as “1900/7/21”, change the cell format to General or Number and it becomes a day count like 203.
- DATEDIF is a hidden function that does not appear in the function list, but it works in both Excel and Google Sheets. It returns an error if the start date is later than the end date, so watch the order.
- Microsoft itself warns that DATEDIF with "MD" (days beyond whole months) can return inaccurate results around month ends. Double-check results when you build “X months Y days”.
- NETWORKDAYS counts both the start and end dates, while WORKDAY skips the base date and starts from the next business day. Different functions treating the ends differently is another common source of off-by-one errors.
Days excluding weekends and holidays (business days) are counted differently
Everything so far counts calendar days, where weekends and holidays count as days like any other. Deadlines set in business days, such as “3 business days later” or “within 10 business days”, skip the days off and therefore land later than the same number of calendar days. Three business days after a Friday is the following Wednesday, five calendar days later.
| Method | Days counted | 3 days after Friday, October 2, 2026 |
|---|---|---|
| Calendar days | Every day | Monday, October 5 |
| Business days (weekends and holidays off) | Only days the business is open | Wednesday, October 7 |
Where business-day counting starts and how it shifts across long holidays is explained in how to count business days.
Common mistakes when counting days
| Common mistake | Example | The right way to think about it |
|---|---|---|
| Getting “N days long” by subtraction alone | Calling November 1–10 nine days | Both ends count, so add 1: 10 days |
| Adding 1 to “N days later” | Saying 10 days after November 1 is November 12 | The base date is day 0; 10 days later is November 11 |
| Treating every month as 30 days | Calling March 15 – June 30 105 days | Add each month's real length: 107 days |
| Assuming February has 28 days | Calling 2028/2/1 – 3/1 28 days | 2028 is a leap year, so 29 days |
| Counting “within 1 month” as 30 days | Saying 1 month after January 31 is March 2 | Count by calendar: the end of February |
| Panicking when Excel shows a date | =B2-A2 shows 1900/7/21 | Format the cell as a number: 203 days |
Every one of these is avoided by checking two things: whether the first day counts, and how long the months in between are. For a count done by hand, add the days back to see whether you return to the original date. The more important the deadline, the more worthwhile it is to note down the date and the counting method you used.
Counting days with the tools
You can count the days between dates right in your browser with the business day calculator and the age & anniversary counter. In both, the dates you enter are calculated only in your browser and are not sent to a server.
- 1
Days between two dates: the “Business days in a period” tab of the business day calculator
Enter a start date and an end date, and “Calendar days” appears next to the number of business days. Under “How to count days” you can switch between “Include both ends”, “Exclude the first day”, “Exclude the last day” and “Exclude both ends”, so you can compare one-end and both-end answers on the spot.
- 2
The date N days later or earlier: set the “N business days after/before” tab to open every day
In “Closed day settings”, choose the “Open every day” preset. Every day then counts as a business day, so the tool shows the calendar date and weekday N days later or earlier. You can enter 0 to 3,000 days and switch between “Exclude the first day” and “Include the first day”.
- 3
Days since or until a date: the “Anniversary count” tab of the age & anniversary counter
Enter a date to see the days remaining (for a future date) or days elapsed (for a past date), also shown as “X years, Y months, Z days” and in weeks. Milestones such as 100 and 1,000 days are listed with their dates, so it also works as a countdown.
- 4
Days since a birth date: the “Find age” tab
Enter a date of birth and a reference date to see the age and “Days since birth”. By changing the reference date, you can also use it to check the period between any two dates as “X years, Y months, Z days”.
The business day calculator's results can be pasted anywhere with “Copy summary”, and the age & anniversary counter can send the same screen to someone else with a share URL. When confirming a deadline with another person, share the counting settings along with the date, and arguments over a one-day difference disappear.
FAQ
- How do I calculate the number of days between two dates?
- Subtract the start date from the end date. From November 1 to November 10, 10 − 1 = 9 days, which counts one end only, the same as “N days later”. To include both days (“N days long”), add 1 for 10 days; to count only the days in between, subtract 1 for 8 days. Across months, add up the lengths of the months in between (30 or 31 days, and 28 or 29 for February).
- What is the difference between counting one end and counting both ends?
- Counting one end includes only the start date or only the end date; it is used for “N days later”, days elapsed and hotel nights. Counting both ends includes both dates and is used for “from X to Y”, “N days long” and hospital stays. For the same period, counting both ends always gives one day more.
- What date is 100 days from today?
- Add 100 days to today's date. Because 100 divided by 7 leaves a remainder of 2, the weekday is two days after today's. For example, 100 days after Sunday, November 1, 2026 is Tuesday, February 9, 2027. If you count today as day 1, “day 100” is one day earlier, 99 days later.
- When is the deadline for “within 10 days”?
- Unless a law or contract says otherwise, Japan's Civil Code Article 140 excludes the first day, so the next day is day 1 and the deadline is the end of the 10th day. If you were notified on November 1, the deadline is November 11. Some rules, such as Japan's cooling-off period, count the day of receipt as day 1, in which case the deadline is November 10. For important deadlines, check how the rules count.
- Can I treat one month as 30 days?
- For deadlines and contracts, “one month” is counted by calendar date (the corresponding day), not by days. One month after January 31 is the end of February, because there is no February 31. Treating it as 30 days gives March 2, two days off. If you only need a rough conversion from days to months, divide by about 30.44 days per month.
- What Excel formula gives the days between two dates?
- With the start date in A2 and the end date in B2, =B2-A2 gives the days counting one end and =B2-A2+1 gives the days including both ends. =DATEDIF(A2,B2,"D") gives the same day count. If the result appears as a date, change the cell format to General or Number. To exclude weekends and holidays, use =NETWORKDAYS(A2,B2,holiday_range).
- How do I find which day of the year today is?
- Take the day of the year for the 1st of the month (in a common year: Jan 1, Feb 32, Mar 60, Apr 91, May 121, Jun 152, Jul 182, Aug 213, Sep 244, Oct 274, Nov 305, Dec 335) and add the day of the month minus 1. October 21 is 274 + 20 = day 294. In a leap year, every value from March onward is one higher.
- How does crossing a leap year change the day count?
- A period that contains February 29 is one day longer than the same period in a common year. 2028 is a leap year, so February 1 to March 1, 2028 is 29 days, compared with 28 days in 2027. A year that crosses February 29 has 366 days, and the weekday moves forward by two.
- Can I also count days excluding weekends and holidays?
- Yes. Enter a start and end date in the “Business days in a period” tab of the business day calculator to see the number of business days, excluding weekends and Japanese public holidays, alongside the calendar days and a breakdown of the days off. You can also set your own closed weekdays and company holidays. In Excel, use =NETWORKDAYS(start,end,holiday_range).
Tools in this article
Related articles
How to Count Business Days: When Is “3 Business Days Later”? First-Day Rules, Weekends and Holidays
When someone says “we'll ship within 3 business days”, the actual date and weekday are surprisingly hard to pin down. You know to skip weekends, but whether you start counting on the same day or the next, and how to treat holidays in between, shifts the answer by a day, or by several days across a long holiday. This guide sorts out how to count business days starting from the first-day rule, so you can check against real dates.
Read article →How Leap Years Are Determined: The Rules, and How People Born on February 29 Age
Most people remember leap years as “once every four years”, but that alone doesn't explain the exceptions. This guide covers the three rules for deciding whether a year is a leap year, why once every four years isn't quite enough, and when someone born on February 29 turns a year older in a common year.
Read article →How Age Is Counted in Japan: Western Age vs. Kazoedoshi (East Asian Age) and How to Build an Age Chart
Ever been asked “How old are you in kazoedoshi?” and drawn a blank? Japan has two ways of counting age: man-nenrei, the Western-style age everyone uses day to day, and kazoedoshi, the traditional East Asian age reckoning. They differ only in where the count starts, but kazoedoshi is still the standard for Shichi-Go-San, yakudoshi (unlucky years), and longevity celebrations. This guide explains the difference between the two and how to check both at once from a date of birth.
Read article →