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)
| Argument | Required? | What it is |
|---|---|---|
end_date | Required | The later date. |
start_date | Required | The 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.
| Cell | Formula | Result | What it shows |
|---|---|---|---|
| E2 | =DAYS(C2,B2) | 30 | Thirty days from sent to paid |
| E3 | =DAYS(B3,C3) | -11 | Arguments swapped: the result is negative |
| E4 | =C2-B2 | 30 | Plain 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
| Invoice | Sent | Paid | Result | |
| INV-201 | 2/2/2026 | 3/4/2026 | 30 | |
| INV-202 | 2/16/2026 | 2/27/2026 | -11 | |
| 30 |
Practice DAYS
Graded instantly, then re-checked on changed data.
Days to pay
D2, count the days from each invoice's sent date to its paid date. Fill down to D6.Common mistakes
| What you see | Why, and how to fix it |
|---|---|
| A negative number | The 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 skip | DAYS 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.