DAYS function in Excel is used to calculate the number of days between two dates. It is useful in tracking project deadlines, employee attendance, invoices, or subscription periods. In this article, you will learn how to use the DAYS formula in Excel.
Key Takeaways:
- The DAYS function calculates the number of days between two dates.
- Enter the end date first and the start date second.
- The result can be positive, negative, or zero.
- DAYS automatically handles leap years without extra formulas.
- It is useful for deadlines, billing, and date tracking.
Table of Contents
DAYS Formula: An Introduction
The DAYS function calculates the number of days between two dates in Excel. It is less error-prone than manually subtracting one date from another. The syntax of DAYS formula is:
=DAYS(end_date, start_date)
- end_date → The later date
- start_date → The earlier date
Step-by-Step Guide to DAYS Formula in Excel
STEP 1: We need to enter the DAYS function in a blank cell:
STEP 2: The DAYS arguments: end_date
What is the ending date?
Select the cell containing the ending date:
start_date
What is the starting date?
Select the cell containing the starting date:
Apply the same formula to the rest of the cells by dragging the lower-right corner downwards.
You now have your differences in days!
Real-Life Use Cases
1. Project Deadlines
When managing projects, I often have a target completion date and a current date. With DAYS, I can instantly see how many days are left:
If the result is negative, I know that the deadline has passed. It can also be useful in catching any data entry errors, like typing 2027 instead of 2026.
2. Age in Days
It can be used to calculate the exact age of a person.
In seconds, I had the number. It would’ve taken me way longer to count month-by-month.
3. Rental Periods & Billing
For invoicing rental equipment, I use DAYS to figure out exactly how many days a customer kept an item.
Multiply that by the daily rate, and the math is airtight.
4. Event Planning
When planning events, DAYS helps me keep track of countdowns. I’ll set up a “Days Left” column:
When that hits zero, I know it’s go-time.
Common Errors to Avoid
Reversing the Dates
The syntax requires the end date first and the start date second. If you reverse them, Excel returns a negative number instead of a positive value.
Using Text Instead of Dates
If a cell contains text that Excel does not recognize as a valid date, the DAYS function returns a #VALUE! error. Always make sure your dates are stored as actual Excel dates.
Including Time Values
The DAYS function calculates only the difference between dates. Any time values included in the cells are ignored.
FAQs
What is DAYS function?
The DAYS function returns the total number of days between two dates. t is commonly used to calculate deadlines, project durations, and billing periods.
What is the syntax of the DAYS function?
The syntax is =DAYS(end_date, start_date). Always enter the ending date as the first argument and the starting date as the second argument.
Can the DAYS function return a negative number?
Yes. It returns a negative value if the end date is earlier than the start date. A negative result simply indicates that the dates were entered in reverse order or that the end date has already passed.
Does the DAYS function work with text dates?
It works only if Excel recognizes the text as a valid date. If the text is not in a valid date format, the function returns a #VALUE! error. Converting the text to a proper date fixes the issue.
Can I use the DAYS function with TODAY()?
Yes. It can calculate the number of days from today to another date.
Bryan
Bryan Hong is an IT Software Developer for more than 10 years and has the following certifications: Microsoft Certified Professional Developer (MCPD): Web Developer, Microsoft Certified Technology Specialist (MCTS): Windows Applications, Microsoft Certified Systems Engineer (MCSE) and Microsoft Certified Systems Administrator (MCSA).
He is also an Amazon #1 bestselling author of 4 Microsoft Excel books and a teacher of Microsoft Excel & Office at the MyExecelOnline Academy Online Course.









