We’re improving Formula Genius. We’re redesigning the app and fixing issues along the way. Sorry for any disruption, and thank you for your patience.
Excel beginner

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

Prompt

"Calculate how many days remain until a deadline, showing 0 instead of a negative number if the deadline has passed"

Excel
=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

  1. A1 refers to the cell containing the deadline date.
  2. TODAY() returns the current date.
  3. A1 - TODAY() calculates the difference in days between the deadline and today.
  4. 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

Prompt

"Deadline is 2023-12-31 and today is 2023-12-01"

Excel
30
Prompt

"Deadline is 2023-10-01 and today is 2023-10-05"

Excel
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.