Spreadsheet Practice

DAYS function

DAYS returns the number of days between two dates. It gives the same answer as subtracting one date from the other, but the argument order (end date first) makes the intent clear, and it accepts dates written as text. Use it for invoice ages, lead times and time between events.

Available in
Excel 2013 and later
Category
Date functions
Returns
A whole number of days, negative if start_date is later than end_date.
Google Sheets
Works the same in Google Sheets.

Syntax

=DAYS(end_date, start_date)

ArgumentRequired?What it is
end_dateRequiredThe later date.
start_dateRequiredThe earlier date. If it is after end_date, the result is negative.

Examples

Each result below is calculated from the sample sheet by our formula engine, the same one that grades the practice.

CellFormulaResultWhat it shows
E2=DAYS(C2,B2)30Thirty days from sent to paid
E3=DAYS(B3,C3)-11Arguments swapped: the result is negative
E4=C2-B230Plain subtraction gives the same 30 days

Try it live

This is the sample sheet. Change any number or text, or edit a formula, and the results update.

Show the sample data as a table
InvoiceSentPaidResult
INV-2012/2/20263/4/202630
INV-2022/16/20262/27/2026-11
30

Practice DAYS

Graded instantly, then re-checked on changed data.

Days to pay

In D2, count the days from each invoice's sent date to its paid date. Fill down to D6.

Common mistakes

What you seeWhy, and how to fix it
A negative numberThe arguments are in start, end order. DAYS takes the end date first: DAYS(end_date, start_date).
#NAME?DAYS arrived in Excel 2013. In older versions, subtract the dates instead: =C2-B2.
Counting weekends you meant to skipDAYS counts every calendar day. Use NETWORKDAYS for working days.

Tips

  • Add 1 when both the start and end day should count, such as for a hotel stay or a leave request.

Questions

How do I count the days between two dates in Excel?

Use =DAYS(end_date, start_date), or simply subtract: =B2-A2. Both return the number of calendar days.

Does DAYS include both the start and end date?

No. DAYS("2026-03-02","2026-03-01") returns 1. Add 1 if you want to count both days.

What is the difference between DAYS and NETWORKDAYS?

DAYS counts every calendar day. NETWORKDAYS counts weekdays only, and can also skip a list of holidays.

Last reviewed October 2026. Every example result on this page is calculated live by the Spreadsheet Practice formula engine.