Days Left and Deadlines
About this lesson
Days left until a deadline is the due date minus the as-of date. Dates are serial numbers, so the result is negative once the deadline has passed.
- work out the days left until a deadline against an as-of date.
- flag overdue items with an IF on the date.
The idea
Everything about deadlines follows from dates being numbers. Due minus as-of is the days left. Below zero means overdue. Earlier is less-than. DAYS(end, start) is the same subtraction with the arguments named. It is the version to use when the sheet will be read by somebody else.
The as-of date is in a cell on purpose. TODAY() would make every figure move overnight. That is what you want on a live tracker, and not what you want on a report that says "as of 19 March". Put the date in one cell, lock it, and change it on purpose.
The mistake to watch for
Flipping the sign of an overdue task. Days left below zero is the information. Keep the negative number, and a test for less than zero finds every late task. And put the as-of date in a locked cell instead of typing TODAY into every formula. Then a report that says "as of 19 March" still says that next week.
Read more about this
Where this comes up again
This lesson needs JavaScript to run. Everything below is the lesson in full, but you cannot type into the grid or be marked.
In D2, type:
=B2-$B$7
B7 holds the as-of date, locked so it does not move.
| Row | A | B | C | D | E | F | G |
|---|---|---|---|---|---|---|---|
| 1 | Task | Due | Due shown | Days left | Status | ||
| 2 | Draft | 45380 | 29 Mar | ||||
| 3 | Review | 45373 | 22 Mar | ||||
| 4 | Sign-off | 45400 | 18 Apr | ||||
| 5 | Publish | 45366 | 15 Mar | ||||
| 6 | |||||||
| 7 | As of | 45370 | 19 Mar | ||||
| 8 |
Every step
-
In
D2, type:=B2-$B$7.B7holds the as-of date, locked so it does not move. -
In
D3, useDAYSwithB3andB7. It takes the end date first and the start date second. -
Publish was due before the as-of date. Read
=B5-$B$7and say what it returns. -
In
E2, useIFto show Late ifB2is beforeB7. Shape:=IF(test, if_true, if_false). Otherwise show On time. -
In
E5, useIFto show Overdue ifB5is beforeB7. Shape:=IF(test, "text", value). Otherwise show the days left. Remember: text goes in quotes, numbers do not.