Going Stellar

Home/Google Sheets reference

Google Sheets function · Date

DAYS in Google Sheets: syntax and examples

DAYS subtracts one date from another and returns the difference in days. The end date comes first and the start date second. For months or years between dates, use DATEDIF.

Syntax

DAYS(end_date, start_date)

Arguments

ArgumentTypeRequiredWhat it does
end_datedateyesThe later date. It comes first.
start_datedateyesThe earlier date.

Examples

The examples use this table, starting in A1:

StartEnd
4602346096
=DAYS(B2, A2)

Result: 73

Days from 1 January to 15 March 2026.

Run in a Google Sheet (English US locale) on .

=DAYS(A2, B2)

Result: -73

Swap the arguments and the result turns negative.

Run in a Google Sheet (English US locale) on .

=DAYS(DATE(2026, 12, 31), DATE(2026, 1, 1))

Result: 364

Days between the first and last day of a year. The count excludes the start day.

Run in a Google Sheet (English US locale) on .

=DAYS(DATE(2024, 3, 1), DATE(2024, 2, 1))

Result: 29

February 2024 is a leap month, so 29.

Run in a Google Sheet (English US locale) on .

=DAYS("2026-03-15", "2026-01-01")

Result: 73

Text dates in year-month-day form.

Run in a Google Sheet (English US locale) on .

Common errors

  • The order is end date first, then start date. Reversed arguments give a negative number, as in DAYS(A2, B2) above.
  • The count excludes the start day. 1 January to 15 March 2026 is 73, not 74.
  • The time of day is dropped from each date first. Two moments 0.02 days apart on different calendar days count as 1.
  • Text that is not a date returns #VALUE!. A text date such as "15.03.2026" also returns #VALUE! in en_US, while "2026-03-15" works in both locales.

Compared with Excel

Same syntax in Excel.

Sources

  1. DAYS (Docs Editors Help)

Markdown version · All functions