Calculation Issues

Calculate Aging Days in Excel Using a Sale Date or Today

John WilsonJohn Wilson Dec 2, 2026 869 views

Question details

Calculate the number of days between a start date and either a sale date or today.

Calculate Aging Days in Excel Using a Sale Date or Today
Product
Microsoft Excel and WPS Spreadsheets
Device & OS
not provided
Scenario
An item has a start date and may or may not have a sale date.
Observed behavior
The desired result is the number of days from the start date to the sale date, or to today if the sale date cell is blank.
Before you start

Confirm that the start date is in G5 and the optional sale date is in H5, or adjust the cell references in the formula. Enter dates as recognized spreadsheet dates rather than text.

Solution 1Recommended

Use an IF Formula to Calculate Aging Days

Use this formula to calculate through the sale date when H5 has a date, or through today when H5 is blank.

1
Enter the dates

Enter the item's start date in G5. Enter the sale date in H5 if it is available; otherwise, leave H5 blank.

2
Enter the formula

Select the cell where you want the aging result, enter =IF(H5="",TODAY()-G5,H5-G5), and press Enter.

3
Format and copy the result

If the result appears as a date, select the result cell and choose General or Number from the Home tab's number format menu. Drag the fill handle down to apply the formula to other rows.

Use an IF Formula to Calculate Aging Days
Check the dates: The formula counts the difference between dates, not including the start day. A sale date earlier than the start date returns a negative number. Entries containing times can produce fractional days.
Calculate aging days in WPS

Calculate Aging Days in WPS Spreadsheets

Use the same IF and TODAY formula in WPS Spreadsheets to track an item's age until its sale date or through today.

  1. 1. Open your spreadsheet: Open WPS Spreadsheets and select File > Open to open your workbook.
  2. 2. Check the date columns: Enter or verify the start date in G5 and the optional sale date in H5.
  3. 3. Add the aging formula: Select an empty result cell, enter =IF(H5="",TODAY()-G5,H5-G5), and press Enter.
  4. 4. Apply it to other rows: Use the Home tab's number format menu to select General or Number if needed, then drag the result cell's fill handle down.
Calculate aging days automatically when the sale date is blank.Open and edit Microsoft Excel XLS and XLSX files.Copy the formula down to calculate aging for multiple items.Use familiar spreadsheet controls in a free office suite.
microsoft office alternative - wps office

Frequently Asked Questions

What happens when I enter a sale date later?

When you enter a date in H5, the formula changes from TODAY()-G5 to H5-G5, so the result reflects the period up to the sale date.

Why does the aging result look like a date?

The result cell may have a date format. Select it and choose General or Number from the Home tab's number format menu.

Does the formula include the start day?

No. Subtracting the start date from the end date returns the elapsed days between them. For example, January 1 to January 3 returns 2.

Why is the aging result negative?

Check G5 and H5: a sale date earlier than the start date produces a negative result. A future start date can also produce a negative result when H5 is blank.

Will the result update each day if the sale date is blank?

Yes. TODAY() returns the current date when the workbook recalculates, so the aging result can increase as days pass.