Count Days Between Dates in Excel When the End Date Is Blank
Question details
Calculate the number of days between a start date and an end date, or through today if the end date is missing.

- 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.
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.
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.
Select C2 and enter =IF(A2="","",IF(B2<>"",B2-A2,TODAY()-A2)).
Select C2, then choose Home > Number Format > General or Number so the result displays as a day count rather than a date.
Drag the fill handle from C2 down the duration column to copy the formula for additional records.
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.

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. Open the worksheet: Open WPS Spreadsheet and select File > Open to choose your workbook.
- 2. Enter the dates: Enter the start date in A2 and, if the process is complete, the end date in B2.
- 3. Add the formula: Select C2 and enter =IF(A2="","",IF(B2<>"",B2-A2,TODAY()-A2)).
- 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.

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.




