Days between two dates

Lesson 33 of 54

Subtract the earlier date from the later one: =end - start. Spreadsheets store dates as day numbers, so the result is the number of days.

In cell D2, write a formula that counts how many days order #1001 took to arrive (Delivered minus Ordered). It should still work when filled down to D3 and D4.

D2
ABCD
1OrderOrderedDeliveredDays to arrive
2#10011/5/20261/12/2026
3#10021/8/20261/20/2026
4#10031/15/20262/2/2026

Type in the formula bar above and press Enter to check.

Skip

How to count days between dates

Syntax

=end_date - start_date    or    =DAYS(end_date, start_date)
end_date - start_date
Plain subtraction. Format the result as a number, not a date.
DAYS(end, start)
The same result as a function; note the end date comes first.
NETWORKDAYS(start, end)
Use instead when you only want weekdays.

Example

A project started on the date in B2 and you want how many days it has been running.

=TODAY() - B2

Updates every day. Add 1 if both the start and end day should count.

Common mistakes

  • The result shows as a date like 1/14/1900. Change the cell format to Number.
  • Dates typed as text (left-aligned) give #VALUE!. Re-enter them or convert with DATEVALUE.

Questions people ask

How do I count months or years between dates?

Use DATEDIF: =DATEDIF(B2, C2, "M") for whole months, "Y" for years.

Practice it above: type the formula in the formula bar and press Enter to check.