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.
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.
The report date is in B7. In D2, work out how many days are left until the draft is due. That is the due date minus the as-of date, with the as-of date locked.
To begin, type it exactly:
=B2-$B$7
| 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
-
The report date is in
B7. InD2, work out how many days are left until the draft is due. That is the due date minus the as-of date, with the as-of date locked. To begin, type it exactly:=B2-$B$7. -
In
D3, the same thing for the review, with theDAYSfunction. It takes the end date first and the start date second. -
Publish was due before the report date. Read
=B5-$B$7and say what it returns. -
In
E2, mark the draft Late if its due date is before the as-of date. Otherwise mark it On time. -
In
E5, write a formula usingIFfor the publish task. Show Overdue when its due date is past. Otherwise show the number of days left.