How to Calculate Task Completion Time in Days in Excel
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.

- 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.
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.
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.
Click on the cell where you want the total completion time (in days) to appear.
Go to the Home tab on the Excel ribbon, locate the Number Format dropdown, and change it from 'Date' to 'General' or 'Number'.
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.
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.

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. Open your document: Launch WPS Spreadsheet and open your project tracker.
- 2. Format the destination cell: Select the target cell, go to the Home tab, and ensure its format is set to 'Number'.
- 3. Input the formula: Type =IF(C1="",TODAY()-B1,C1-B1) into the cell and press Enter.
- 4. Fill the column: Drag the fill handle down to effortlessly copy the formula for your entire task list.

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)).




