Calculate Date Differences in Excel
Find the exact number of days, months, or years between two dates. Including business days that skip weekends and holidays.
Formula Genius can generate a draft from a plain-English prompt. Supported formulas can be checked with sample cases; review the coverage on the result.
The formula
"Calculate the number of business days between two dates, excluding weekends"
=NETWORKDAYS(A2,B2)
NETWORKDAYS counts the number of working days (Monday through Friday) between two dates, automatically excluding weekends.
Step-by-step breakdown
- A2 is the start date
- B2 is the end date
- Weekends (Saturday and Sunday) are automatically excluded
- Optional third argument: a range of holiday dates to also exclude
- For simple day count: =B2-A2 (includes weekends)
Edge cases & warnings
- Both start and end dates are included in the count
- If end date is before start date, returns a negative number
- Non-date values return #VALUE! error
- For months between dates: =DATEDIF(A2,B2,"M")
- DATEDIF is undocumented but works — it's a compatibility function from Lotus 1-2-3
Examples
"Start: Jan 1, End: Jan 31"
23 business days (excluding 8 weekend days)
"Start: Dec 20, End: Jan 3 (with holidays)"
=NETWORKDAYS(A2,B2,holidays) excludes holidays too
Frequently asked questions
How do I include holidays?
Add a range of holiday dates as the third argument: =NETWORKDAYS(A2,B2,D2:D10) where D2:D10 lists your holiday dates.
How do I get months between dates?
Use =DATEDIF(start,end,"M") for complete months, or =(YEAR(B2)-YEAR(A2))*12+MONTH(B2)-MONTH(A2) for a month count.
Can't find what you need?
Describe a formula in plain English. Formula Genius drafts and explains it, and can check supported formulas on sample cases.