Formula example
Calculate Days Between Dates
You have a start date in A2 and an end date in B2 and need the number of days between them.
Copyable formula
=B2-A2 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 |
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.
Build your own version
Use the deterministic 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?
Use NETWORKDAYS for business-day counts.