Date & Time
DAYS Function in Excel
Returns the number of days between two dates.
Syntax
- =DAYS(end_date, start_date)
Arguments
- end_date (required): End date
- start_date (required): Start date
Examples
- =DAYS("12/31/2024", "1/1/2024") - Days in 2024 - Result: 365
Excel DAYS function documentation
- DAYS returns the number of days between two dates as end_date minus start_date.
- Syntax: =DAYS(end_date, start_date). Useful for invoice aging, SLAs, and delivery tracking.
- Use DAYS with [DATE](/functions/date/) to avoid ambiguous text-date inputs.
- Category reference: [/categories/date-time/](/categories/date-time/).
DAYS syntax and sign behavior
- end_date and start_date are both required for a valid result.
- A positive result means end_date is after start_date; negative means the opposite.
- DAYS counts calendar days and includes leap-day effects automatically.
- Invalid text dates or mixed locale formats can return #VALUE!.
Step-by-step: calculate aging buckets
- Step 1 - Put invoice date in A2 and payment date or TODAY() in B2.
- Step 2 - Use =DAYS(B2,A2) in C2 for age in days.
- Step 3 - Add bucket logic: =IF(C2>60,"60+",IF(C2>30,"31-60","0-30")).
- Step 4 - Build a pivot table to summarize open balances by bucket.
DAYS vs subtraction vs DATEDIF
- DAYS is explicit and readable for day differences in dashboards.
- Direct subtraction (end-start) returns the same value with shorter syntax.
- DATEDIF is better when you need months or years, not only day count.
- Format with [TEXT](/functions/text/) only for labels, not numeric logic.
Worked examples to copy
- Basic gap: =DAYS("2026-12-31","2026-01-01").
- From cells: =DAYS(B2,A2).
- Days until due date: =DAYS(due_date,TODAY()).
- Absolute difference: =ABS(DAYS(B2,A2)).
People also ask
- Does DAYS count weekends? - Yes, it counts all calendar days.
- Can DAYS return negatives? - Yes, when end_date is earlier than start_date.
- DAYS vs NETWORKDAYS? - NETWORKDAYS excludes weekends and optional holidays.
- Why #VALUE! in DAYS? - One or both arguments are not valid dates.
Common errors
- Order matters: end_date - start_date
Use cases
- Duration calculations
- Age calculations
- Project timelines
Frequently asked questions
- What is the difference between DAYS and simple subtraction? DAYS(end, start) is equivalent to end - start for dates. The main advantage of DAYS is clarity - it's obvious you're calculating days. Also, DAYS can convert text dates automatically, while subtraction might not.
- How do I calculate days including both start and end dates? DAYS counts the difference, excluding the start date. To include both dates, add 1: =DAYS(end, start) + 1. For a 3-day event from Jan 1-3, DAYS returns 2, but adding 1 gives 3 days total.
- How do I calculate days remaining until a deadline? Use =DAYS(deadline, TODAY()) for calendar days remaining. For working days, use =NETWORKDAYS(TODAY(), deadline). Negative result means the deadline has passed.
Editorial review
- Reviewed by Excel.Directory Editorial Team. Updated May 2026.
When to use DAYS
- Duration calculations — common Date & Time scenario for DAYS.
- Age calculations — common Date & Time scenario for DAYS.
- Project timelines — common Date & Time scenario for DAYS.
DAYS in the Date & Time category
- Browse all Date & Time functions at /categories/date-time/ for related formulas.
- DAYS syntax: =DAYS(end_date, start_date)
- end_date (required): End date
- start_date (required): Start date
- Confirm DAYS arguments match the syntax shown above before filling down.
- Lock table and range references with $ when copying formulas across rows or sheets.
Formula checklist before you copy down
- Confirm DAYS arguments match the syntax shown above before filling down.
- Lock table and range references with $ when copying formulas across rows or sheets.
- If results look wrong, check for text stored as numbers and invisible spaces with TRIM.
- Spot-check three known input rows manually against expected output.
Related Excel functions
- DATEDIF (/functions/datedif/): Calculates the number of days, months, or years between two dates.
- NETWORKDAYS (/functions/networkdays/): Returns the number of whole working days between two dates, excluding weekends and holidays.
- DAYS360 (/functions/days360/): Returns the number of days between two dates based on a 360-day year.
Errors to watch for
- Order matters: end_date - start_date — review causes on linked error pages in the directory.
Copy-paste audit workflow
- Enter DAYS on three test rows with known expected output documented on a QA tab.
- Fill down only after absolute references are locked on lookup tables and rate tables.
- Compare against manual calculation or a calculator for financial and statistical functions.
- Search this directory for comparison guides when choosing between similar functions in the same category.
DAYS worked examples to copy
- =DAYS("12/31/2024", "1/1/2024") — Days in 2024. Expected result: 365.
DAYS reference summary for crawlers and offline review
- DAYS belongs to the Date & Time category in Excel. Returns the number of days between two dates.
- Full syntax: =DAYS(end_date, start_date). Open /functions/days/ for parameters, FAQs, and related pages.
- Common mistakes: Order matters: end_date - start_date
- Pair this function with comparison guides when another Excel formula might fit the same task better.
- Review fix-excel-formula-errors when unexpected errors appear after upgrading Excel or sharing across locales.