Formula example
Calculate Days Between Dates Formula Example
Calculate elapsed calendar days between a start date in A2 and an end date in B2. From 2026-01-01 to 2026-01-31, the formula returns 30.
Copyable formula
=B2-A2Returns 30 for 2026-01-01 through 2026-01-31 because it counts elapsed days between the dates.
Useful variations
=B2-A2Counts the number of day boundaries between the start and end dates.
=B2-A2+1Use this when both the start date and end date should be counted.
=ABS(B2-A2)Use this when the input order may be reversed and you only need the distance between dates.
=NETWORKDAYS(A2,B2)Counts weekdays and excludes weekends. Excel and Google Sheets also support an optional holiday range.
Sample data
| Start Date | End Date | Days |
|---|---|---|
| 2026-01-01 | 2026-01-31 | 30 |
| 2026-02-10 | 2026-03-12 | 30 |
| 2026-04-15 | 2026-05-01 | 16 |
When to use this formula
- You need elapsed calendar days between two real spreadsheet dates.
- The result should update when either date cell changes.
- You want a simple formula before moving to business days, months, or age calculations.
Elapsed days versus inclusive days
B2-A2 returns elapsed days. If the start date and end date should both count as part of a booking, rental, or coverage period, use B2-A2+1 instead.
Excel and Google Sheets behavior
Both Excel and Google Sheets store dates as serial numbers, so subtracting two real date cells works the same way. If a date is stored as text, convert it before subtracting.
When to use NETWORKDAYS
Use NETWORKDAYS when weekends should not count. Add a holiday range as the third argument when company holidays or public holidays should also be excluded.
Returned days from the sample data
| Start date | End date | Elapsed days |
|---|---|---|
| 2026-01-01 | 2026-01-31 | 30 |
| 2026-02-10 | 2026-03-12 | 30 |
| 2026-04-15 | 2026-05-01 | 16 |
Date difference choices
| Need | Formula | Result behavior |
|---|---|---|
| Elapsed days | =B2-A2 | Counts days between the two dates. |
| Inclusive days | =B2-A2+1 | Counts both the start and end dates. |
| Positive difference | =ABS(B2-A2) | Avoids negative results when dates are reversed. |
| Business days | =NETWORKDAYS(A2,B2) | Counts weekdays instead of all calendar days. |
Formula explanation
- Spreadsheet dates are stored as serial numbers.
- Subtracting the start date from the end date returns elapsed calendar days.
- For completed months or years, use DATEDIF instead.
Common errors
- Date-looking text may not subtract correctly.
- A negative result means the end date is earlier than the start date.
- If cells include times, decimals may appear in the result.
- Use +1 only when your workflow needs inclusive date counting.
Build your own version
Use the formula builder for this pattern: Date Difference Formula Builder.
Related formulas
FAQ
Should I add one day for inclusive counting?
If both start and end dates should be counted, use =B2-A2+1.
Can this show business days?
Yes. Use NETWORKDAYS(A2,B2) for weekday counts, and add a holiday range if holidays should be excluded.
Why does the result show a decimal?
One or both cells likely include a time value. Format the result as a number or strip the time from the source date cells.
Does the same formula work in Google Sheets?
Yes. Subtracting two real date cells works the same in Excel and Google Sheets.