Formula Errors

Count Days Between Dates in Excel When the End Date Is Blank

Aamir Naveed AkramAamir Naveed Akram Nov 27, 2026 869 views

Question details

Calculate the number of days between a start date and an end date, or through today if the end date is missing.

Count Days Between Dates in Excel When the End Date Is Blank
Product
Microsoft Excel
Device & OS
not provided
Scenario
A process-tracking worksheet has start dates and end dates, but some processes are still in progress.
Observed behavior
The desired formula should leave the result blank until a start date is entered and update the duration when an end date is added.
Before you start

Identify the start-date and end-date columns and make sure entered dates are recognized as dates rather than text. The example below uses A2 for the start date and B2 for the end date.

Solution 1Recommended

Use IF and TODAY to Calculate the Duration

Use this formula to handle both completed and ongoing processes without showing a result when the start date is missing.

1
Enter the formula

Select C2 and enter =IF(A2="","",IF(B2<>"",B2-A2,TODAY()-A2)).

2
Format the result

Select C2, then choose Home > Number Format > General or Number so the result displays as a day count rather than a date.

3
Apply it to other rows

Drag the fill handle from C2 down the duration column to copy the formula for additional records.

4
Test the dates

Enter a start date in A2 and leave B2 blank to count through today. Enter an end date in B2 to calculate the completed duration.

Use IF and TODAY to Calculate the Duration
How the count works: The formula returns elapsed days, excluding the start date. An ongoing duration changes as TODAY() updates when the workbook recalculates.
Calculate process durations

Track Ongoing Durations in WPS Spreadsheet

Use the same IF and TODAY formula in WPS Spreadsheet to count elapsed days for completed and ongoing processes.

  1. 1. Open the worksheet: Open WPS Spreadsheet and select File > Open to choose your workbook.
  2. 2. Enter the dates: Enter the start date in A2 and, if the process is complete, the end date in B2.
  3. 3. Add the formula: Select C2 and enter =IF(A2="","",IF(B2<>"",B2-A2,TODAY()-A2)).
  4. 4. Format and copy: Use the Home tab's number-format controls to set C2 to General or Number, then drag its fill handle down to apply the formula to other rows.
Count days through today when an end date is blankLeave the duration blank until a start date is enteredOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and formatting controls
microsoft office alternative - wps office

Frequently Asked Questions

What happens if the start date is blank?

The formula returns a blank when A2 is empty, even if B2 contains a date.

Will the duration update automatically while the process is ongoing?

Yes. When B2 is blank, the formula uses TODAY(), which updates when the workbook recalculates.

Why does the result look like a date instead of a number?

Select the result cell and choose Home > Number Format > General or Number to display the elapsed day count.

How can I prevent users from entering invalid dates?

Select the date-entry cells in Excel, then use Data > Data Validation and choose Date as the allowed value. Set date limits if needed.