Calculate Days Until a Deadline in Microsoft Project, Excluding Completed Tasks
Question details
Calculate the days remaining until each task deadline while leaving completed tasks blank.

- Product
- Microsoft Project
- Device & OS
- not provided
- Scenario
- A project manager wants to display the time remaining for unfinished tasks in a custom field.
- Observed behavior
- Tasks that are less than 100% complete should show the calculated days until their deadline; completed tasks should show a blank value.
Make sure unfinished tasks have valid Deadline dates and that Percent Complete reflects their status. Check the Current Date in Project > Project Information, because the formula uses the project's current date.
Use a Custom Text Field to Calculate Days Until the Deadline
Add a formula that shows the remaining calendar days for unfinished tasks and leaves completed tasks blank.
The formula counts calendar days, not working days, and adds one to the date difference. Overdue tasks can show zero or a negative value.
In Microsoft Project, open the Project tab and select Custom Fields.
Select Task, choose Text as the field type, and select an unused field such as Text1. Use Rename if you want to give it a descriptive name.
Select Formula and enter IIf([% Complete]<100,DateDiff("d",[Current Date],[Deadline])+1,""). Confirm the formula and close the Custom Fields dialog.
In a task table, select Add New Column and choose the custom text field. Check that unfinished tasks with deadlines show a value and tasks at 100% complete are blank.

Track Task Deadlines in WPS Spreadsheets
WPS Office is a free, lightweight, easy-to-use Office alternative with a familiar interface. Export task data from Microsoft Project to an Excel workbook, then use WPS Spreadsheets to review deadlines and track unfinished tasks. WPS does not fix Microsoft Project custom-field formulas.
- 1. Export task data: In Microsoft Project, use File > Save As and choose an Excel workbook format to export the task fields you need.
- 2. Open the workbook: In WPS Spreadsheets, select Open and choose the exported Excel workbook.
- 3. Review task deadlines: Use the deadline and completion columns in WPS Spreadsheets to review unfinished tasks.

Frequently Asked Questions
Why are completed tasks blank in the custom field?
The IIf formula returns an empty string when Percent Complete is 100%. Tasks below 100% show the calculated date difference.
Does the formula count working days or calendar days?
DateDiff("d",...) counts calendar days. It does not account for weekends, holidays, or the project calendar.
What does the extra day in the formula do?
The +1 includes an additional day in the count, accounting for the difference between the start of the current workday and a typical end-of-day deadline.
Why does an overdue task show zero or a negative number?
The formula subtracts the current date from the deadline and then adds one. A deadline in the past can therefore produce zero or a negative result.
Where can I check the date used by the formula?
Open Project > Project Information and check Current Date. The formula uses that project date rather than a date you enter directly into the formula.




