Calculate the Date Difference
Use valid calendar dates. The result appears above this form after submission.
Example Data Table
| Starting Date | Ending Date | Setting | Months | Remaining Days | Total Days |
|---|---|---|---|---|---|
| January 15, 2024 | March 21, 2024 | Ending date excluded | 2 | 6 | 66 |
| February 1, 2024 | March 1, 2024 | Ending date excluded | 1 | 0 | 29 |
| June 10, 2024 | June 10, 2024 | Ending date included | 0 | 1 | 1 |
Formula Used
The calculator uses calendar intervals. It first finds complete years, months, and days between the selected dates. Complete years are converted to months.
Complete months = (years × 12) + remaining calendar months.
Remaining days = days left after complete months are removed.
Total elapsed days = ending date − starting date. Add one day when the ending date is included.
Complete months: =DATEDIF(A2,B2,"m")
Remaining days: =DATEDIF(A2,B2,"md")
Total days: =B2-A2
Inclusive total days: =B2-A2+1
How to Use This Calculator
- Choose the earlier date as the starting date.
- Choose the later date as the ending date.
- Select the output view that matches your task.
- Tick the ending-date option when both dates must be counted.
- Select the calculation button and read the result above the form.
- Copy the displayed formula into your worksheet when needed.
Working With Month and Day Calculations
Date calculations look simple until months have different lengths. A month can contain twenty eight, twenty nine, thirty, or thirty one days. That changes the answer whenever a date crosses a month boundary. A reliable calculation separates complete months from the days left over. This page follows that calendar pattern. It gives a result that is easy to compare with common worksheet formulas.
Start by deciding what the result should represent. Some tasks need total elapsed days only. Other tasks need full calendar months plus remaining days. Payment terms, subscriptions, service periods, and project schedules often use the second format. A result of two months and six days is clearer than sixty six days when people work with monthly deadlines.
The calculator accepts a starting date and an ending date. It checks that the ending date is not earlier. It then measures the completed calendar intervals between those dates. Years are converted into months for the complete-month result. The leftover portion becomes the remaining-day result. Total days are shown separately. This makes each value useful for a different planning need.
The optional inclusive ending-date setting counts the final date. Choose it when both named dates belong to the period. For example, a leave period from March 1 through March 10 contains ten counted days. Without inclusive counting, the date difference is nine days. Be consistent with your organization’s rule. A small counting choice can change reports and invoices.
In a worksheet, DATEDIF can return full months with the unit "m". It can return leftover days after full months with the unit "md". A direct subtraction returns the elapsed-day count. These formulas are useful, but the dates must be valid date values. Text that only looks like a date can produce unexpected results. Format date cells as dates before calculating.
Month-end dates deserve extra attention. A period beginning on January 31 does not map neatly onto every later month. The calendar adjusts because February is shorter. Check the returned breakdown when the beginning day is near month end. Also check leap years. February has twenty nine days in a leap year, which changes some day totals.
Use the displayed formulas as a reference for your own workbook. Put the start date in one cell and the end date in another. Replace the cell references with your actual locations. Add one to the ending date only when your rule includes that date. Keep the formula beside a clear label. This helps someone else audit the result later.
The output is helpful for more than workbook checks. Use it to review membership periods, warranty coverage, rental terms, employment records, or milestones. Compare the calendar breakdown with total days before making a decision. They answer related but different questions. A careful date calculation prevents avoidable disputes and keeps schedules understandable.
Save original dates beside each result for future checks during audits and reliable reporting.
Frequently Asked Questions
1. What is the difference between complete months and total days?
Complete months count finished calendar-month intervals. Total days count every elapsed day between the selected dates. The values can describe the same period differently, so choose the one that fits your policy.
2. Which formula returns complete months?
Use =DATEDIF(A2,B2,"m"). Put the starting date in A2 and the ending date in B2. The formula returns whole calendar months only.
3. How can I return the days after complete months?
Use =DATEDIF(A2,B2,"md"). It returns the remaining day portion after completed months are removed from the calendar difference.
4. Should I include the ending date?
Include it when the named ending date belongs to the counted period. This is common for leave, reservations, and access windows. Leave it unchecked when measuring elapsed time between two points.
5. Why can month-end dates change the breakdown?
Months do not have identical lengths. A start date near the thirty first may not have a matching day in a shorter month. The calendar rules therefore affect the month-and-day split.
6. Do leap years change the result?
Yes. Leap years add February 29. This changes total days for periods that cross that date and can affect the remaining-day part of the calendar breakdown.
7. Why should worksheet cells contain real dates?
Real date values can be subtracted and used by date functions. Plain text may look correct but fail to calculate consistently. Format the cells as dates after entering valid date values.
8. Can this method be used for age calculations?
Yes. Enter the birth date as the starting date and the chosen reference date as the ending date. Review local legal or organizational rules when an official age definition is required.
9. How do I calculate a partial month?
Use the complete-month result together with remaining days. For example, one month and twelve days is a calendar breakdown. Convert to a decimal month only when your policy defines the conversion rule.
10. Why can a manual count differ from the calculator?
Manual counting may include both endpoints or assume that every month has the same length. Check the inclusive setting, month-end dates, and leap-year dates before comparing results.
11. What happens when the ending date is earlier?
The calculator stops and asks for a valid order. Switch the dates so the starting date is earlier than, or equal to, the ending date.
Clear dates create reliable records for every important deadline.