SpreadsheetFormulas
beginnerTODAYMAX

Calculate Days Remaining Until a Due Date

You have a due-date column and want a countdown next to each item — how many days are left before it's due, with anything already past due showing zero.

Quick formula
=MAX(0,B2-TODAY())
Sample input
1TaskDue Date
2Book venue2026-07-15
3Send contract2026-07-20
4File permits2026-07-01
Result
1TaskDays Remaining
2Book venue7
3Send contract12
4File permits0

Excel & Google Sheets

=MAX(0,B2-TODAY())

This formula works in both Excel and Google Sheets.

How it works

Dates in spreadsheets are numbers, so B2-TODAY() gives the number of days between the due date and today. When the due date is still ahead, that's a positive count of days remaining. Once the date passes, the subtraction goes negative — so MAX(0, …) clamps it and overdue items simply show 0. The countdown refreshes automatically every day the file is opened, because TODAY() always returns the current date. Note the order: it's the mirror image of a days-overdue formula, which subtracts the other way.

B2
The due date.
-TODAY()
Subtracts today. Positive = days still left, negative = already past due.
MAX(0, …)
Shows 0 instead of a negative number once the deadline has passed.

When to use it

Use this for renewal reminders, project countdowns, contract expirations, and warranty windows — anywhere "how long do I have?" drives the next action.

Common mistakes

  • The result displays as a date like 1/7/1900 instead of a number.

    The cell inherited date formatting from the column. Change the cell's number format to Number or General.

  • Overdue items show 0, hiding how late they are.

    MAX(0, …) deliberately flattens overdue items. If you need to see lateness too, add a separate days-overdue column with =MAX(0,TODAY()-B2).

  • Due dates are text, not real dates.

    Subtraction fails with #VALUE! if B2 holds text like "July 15". Convert with DATEVALUE or re-enter as a proper date.

Did this formula help?

Engine-verified against the sample data aboveLast reviewed 2026-07-08