Calculation Issues

How to Calculate Task Completion Time in Days in Excel

Steven ParkerSteven Parker Oct 20, 2026 871 views

Question details

Calculate the duration of a task in days, dynamically using today's date if the completion date is blank, or the actual completion date if it is provided.

How to Calculate Task Completion Time in Days in Excel
Product
Excel
Device & OS
not provided
Scenario
Tracking project task completion times where some tasks are ongoing (blank end date) and some are closed (populated end date).
Observed behavior
The user needs a logical formula that dynamically checks for a blank close date cell and accurately calculates the elapsed days from the assigned date.
Before you start

Ensure your assigned date (e.g., cell B1) and close date (e.g., cell C1) are correctly formatted as Dates in Excel before applying the formula to prevent calculation errors.

Solution 1Recommended

Use the IF and TODAY Functions to Calculate Elapsed Days

This method dynamically calculates the days taken by checking if the end date is blank and substituting it with today's date if necessary.

By combining the IF function with the TODAY function, Excel can logically determine whether a task is finished or still ongoing. If the close date cell is empty, the formula assumes the task is ongoing and calculates the days up to the current date.

1
Select the result cell

Click on the cell where you want the total completion time (in days) to appear.

2
Format the cell as a number

Go to the Home tab on the Excel ribbon, locate the Number Format dropdown, and change it from 'Date' to 'General' or 'Number'.

3
Enter the logical formula

Type the formula =IF(C1="",TODAY()-B1,C1-B1) into the formula bar. This assumes cell B1 contains your assigned date and cell C1 contains your close date.

4
Apply and copy the formula

Press Enter to calculate the elapsed days. Click and drag the fill handle at the bottom-right corner of the cell downwards to apply this formula to the rest of your task rows.

Use the IF and TODAY Functions to Calculate Elapsed Days
Dealing with Date-Formatted Results: If your formula result looks like a strange date (e.g., '1/5/1900'), it means Excel automatically inherited the date formatting from the referenced cells. Simply change the cell format back to 'Number' to view the total days.

Calculate Date Differences Seamlessly in WPS Spreadsheet

WPS Spreadsheet fully supports the IF and TODAY functions, making it incredibly easy to track task durations and manage your project timelines efficiently with an interface you already know.

  1. 1. Open your document: Launch WPS Spreadsheet and open your project tracker.
  2. 2. Format the destination cell: Select the target cell, go to the Home tab, and ensure its format is set to 'Number'.
  3. 3. Input the formula: Type =IF(C1="",TODAY()-B1,C1-B1) into the cell and press Enter.
  4. 4. Fill the column: Drag the fill handle down to effortlessly copy the formula for your entire task list.
Fully compatible with Microsoft Excel formulas, functions, and date formats.Intuitive and user-friendly interface for quickly formatting cells as numbers or dates.Free, lightweight, and fast software for everyday project tracking and data management.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my formula result show up as a date instead of a number?

Excel sometimes automatically inherits the date format from the referenced cells. To fix this, select the result cell, navigate to the Home tab, and change the Number Format dropdown from 'Date' to 'General' or 'Number'.

Can I calculate working days only instead of total calendar days?

Yes, you can use the NETWORKDAYS function to exclude weekends. The formula would be =IF(C1="",NETWORKDAYS(B1,TODAY()),NETWORKDAYS(B1,C1)).

What happens if my assigned start date is blank?

If the start date (B1) is blank, Excel treats it as zero (January 0, 1900), resulting in a massive number of days (usually over 40,000). You can prevent this by wrapping your formula in an additional IF statement: =IF(B1="","No Start Date", IF(C1="",TODAY()-B1,C1-B1)).