How to Calculate Days Until a Deadline in Excel
Need to track deadlines? This formula helps you calculate the days remaining until a deadline, displaying 0 if the date has passed.
Formula Genius can generate a draft from a plain-English prompt. Supported formulas can be checked with sample cases; review the coverage on the result.
The formula
"Calculate how many days remain until a deadline, showing 0 instead of a negative number if the deadline has passed"
=MAX(0, A1 - TODAY())
This formula calculates the number of days until a specified deadline, ensuring that negative results are replaced with zero.
Step-by-step breakdown
- A1 refers to the cell containing the deadline date.
- TODAY() returns the current date.
- A1 - TODAY() calculates the difference in days between the deadline and today.
- MAX(0, ...) ensures that if the result is negative, it returns 0 instead.
Edge cases & warnings
- The deadline is today, resulting in 0 days remaining.
- The deadline has already passed, resulting in 0 days remaining.
- The deadline is in the future, returning the correct number of days.
- The deadline cell is empty, which may cause an error or unexpected result.
Examples
"Deadline is 2023-12-31 and today is 2023-12-01"
30
"Deadline is 2023-10-01 and today is 2023-10-05"
0
Frequently asked questions
What happens if the deadline is today?
The formula will return 0 days remaining.
Can I use this formula for past deadlines?
Yes, it will also return 0 for any past deadlines.
What if the deadline cell is empty?
The formula may return an error; ensure the deadline cell is filled.
Can't find what you need?
Describe a formula in plain English. Formula Genius drafts and explains it, and can check supported formulas on sample cases.