How to Create an Excel Aging Formula for Blank, Future, and Same-Day Dates
Question details
The user needs an Excel formula to calculate the number of days that have passed since a specific date, but requires the formula to leave the cell blank if the reference cell is empty, contains a date in the future, or matches the current date.
- Product
- Excel
- Device & OS
- not provided
- Scenario
- Calculating the aging or elapsed days of an item (e.g., invoices, tickets) from a given start date, while ensuring invalid, future, or same-day dates do not generate negative numbers or zeros.
- Observed behavior
- The desired outcome is a dynamic formula that checks the target date against today's date and outputs either the correct number of elapsed days or an empty string.
Ensure that the cells containing your target dates are formatted as 'Date' rather than 'Text', so the formula can accurately compare them mathematically with today's date.
Use a Nested IF Statement with OR, ISBLANK, and TODAY Functions
By combining these functions, you can create a single formula that validates the date cell first. If the date is blank, today, or in the future, it outputs a blank; otherwise, it subtracts the past date from today.
The IF function allows you to test multiple conditions using the OR function. The ISBLANK function checks for empty cells, preventing Excel from treating blanks as the year 1900. The TODAY() function automatically updates to the current system date, keeping your aging calculations accurate every time you open the workbook.
Click on the cell where you want the elapsed number of days (the aging result) to be displayed.
Type the following formula into the formula bar: =IF(OR(ISBLANK(Z41),Z41>=TODAY()),"",TODAY()-Z41). Note: Replace 'Z41' with the actual cell reference that contains your date.
Press Enter to execute the formula. If the target cell is a past date, the elapsed days will appear.
Click the small square at the bottom-right corner of the selected cell and drag it down to apply this aging calculation to the rest of the column.
Use WPS Spreadsheet for Advanced Date Calculations
WPS Spreadsheet fully supports all standard Excel date and time functions, including IF, ISBLANK, and TODAY. You can seamlessly calculate aging and elapsed days just like you would in Microsoft Excel.
- 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your workbook.
- 2. Input the aging formula: Select the destination cell and enter =IF(OR(ISBLANK(Z41),Z41>=TODAY()),"",TODAY()-Z41).
- 3. Press Enter: Hit Enter to calculate the elapsed days, then use the fill handle to drag the formula down for other rows.

Frequently Asked Questions
Why does my aging formula return a #VALUE! error?
This usually happens if the target cell contains text instead of a valid date format. Check that the cell is formatted as a Date and contains no hidden text characters or leading spaces.
Can I modify this formula to calculate working days only?
Yes, you can calculate business days by replacing the 'TODAY()-Z41' portion of the formula with 'NETWORKDAYS(Z41, TODAY())'. This will exclude weekends from your aging calculation.
How do I calculate aging from a specific date instead of today?
To calculate elapsed days up to a fixed end date rather than today, replace the TODAY() function in the formula with a reference to the cell containing your specific end date. Be sure to lock the end date cell reference (e.g., $A$1) if you plan to copy the formula down.




