SpreadsheetFormulas
beginnerTODAYMAX

Calculate Days Overdue

You have a due-date column and need to see, for each row, how many days late it is — with items that aren't due yet showing zero instead of a negative number.

Quick formula
=MAX(0,TODAY()-B2)
Sample input
1TaskDue Date
2Send contract2026-06-28
3Book venue2026-07-15
4File permits2026-07-01
Result
1TaskDays Overdue
2Send contract10
3Book venue0
4File permits7

Excel & Google Sheets

=MAX(0,TODAY()-B2)

This formula works in both Excel and Google Sheets.

How it works

Dates in spreadsheets are numbers, so TODAY()-B2 gives the number of days between today and the due date in B2. When the due date has passed, that's a positive number of days overdue. When the due date is still ahead, the subtraction goes negative — so MAX(0, …) clamps it: anything not yet due simply shows 0. The value updates every day the file is opened, because TODAY() always returns the current date.

TODAY()
Today's date. Recalculates automatically every day.
-B2
Subtracts the due date. Positive = overdue, negative = still ahead.
MAX(0, …)
Shows 0 instead of a negative number for items not yet due.

When to use it

Use this for aging reports, overdue invoices, late tasks, and expired contracts — anywhere "how late is it?" matters more than a yes/no flag.

Common mistakes

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

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

  • Due dates are text, not real dates.

    Subtraction fails with #VALUE! if B2 holds text like "July 8". 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