Others

Calculate Days Until a Deadline in Microsoft Project, Excluding Completed Tasks

John WilsonJohn Wilson Nov 27, 2026 868 views

Question details

Calculate the days remaining until each task deadline while leaving completed tasks blank.

Calculate Days Until a Deadline in Microsoft Project, Excluding Completed Tasks
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.
Before you start

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.

Solution 1Recommended

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.

1
Open custom fields

In Microsoft Project, open the Project tab and select Custom Fields.

2
Choose a task text field

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.

3
Enter the formula

Select Formula and enter IIf([% Complete]<100,DateDiff("d",[Current Date],[Deadline])+1,""). Confirm the formula and close the Custom Fields dialog.

4
Display the result

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.

Use a Custom Text Field to Calculate Days Until the Deadline
Set a deadline for each unfinished task: The formula needs a valid Deadline date to calculate a result. Add the Deadline column to the task table if you need to enter or review dates.
Free Microsoft Office alternative

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. 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. 2. Open the workbook: In WPS Spreadsheets, select Open and choose the exported Excel workbook.
  3. 3. Review task deadlines: Use the deadline and completion columns in WPS Spreadsheets to review unfinished tasks.
Track task deadlines and completion percentages in a spreadsheetOpen and edit Microsoft Excel XLSX workbooksUse a familiar spreadsheet interface for a smoother transitionWork with a free, lightweight Office alternative
microsoft office alternative - wps office

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.