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

Excel and Google Sheets formula
=B2-A2

Sample data

Start DateEnd DateDays
2026-01-012026-01-3130
2026-02-102026-03-1230
2026-04-152026-05-0116

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.