How to Calculate Time Until an Excel Document Expires in WPS Spreadsheets
Question details
The user wants to calculate the remaining time until a document expiration date in an Excel-compatible spreadsheet.

- Product
- WPS Spreadsheets
- Device & OS
- not provided
- Scenario
- The user has an expiration date stored in a cell and needs to compute how many days or years, months, and days remain before the document expires.
- Observed behavior
- The goal is to display remaining days or a readable duration from the expiration date to today.
Make sure the expiration date is in a valid date cell such as A2, not text. You can quickly check by applying a date format or seeing whether A2 changes to a serial number when you format it as General.
Calculate Remaining Days with =A2-TODAY()
Use this method when you only need the number of days until the expiration date.
WPS Spreadsheets stores dates as serial numbers, so subtracting today's date from the expiration date returns the difference in days.
Click or tap the cell where you want the remaining days to appear.
Type =A2-TODAY() in the formula bar and press Enter.
Right-click the result cell, choose Format Cells, and set the category to Number or General.

Display a Readable Duration with DATEDIF
Use this method to show the remaining time as years, months, and days instead of total days.
Handle Expiration Dates That Include a Time
Use this method when the expiration date cell contains both date and time and you only want to compare the date.
Calculate Expiration Dates Easily in WPS Spreadsheets
Use WPS Spreadsheets to track document expiration with the same Excel formulas such as TODAY, DATEDIF, and IF. It opens and saves .xlsx files with a familiar interface, so you can calculate remaining days without extra cost.
- 1. Launch WPS Spreadsheets: Open WPS Office and click Spreadsheets to create or open an Excel-compatible workbook.
- 2. Enter the expiration date: Type the expiration date into a cell such as A2, ensuring it is recognized as a date.
- 3. Add the remaining-time formula: In another cell, enter =A2-TODAY() or =IF(A2>=TODAY(),DATEDIF(TODAY(),A2,"d")&" days","Expired").
- 4. Format and save: Format the result as Number or General, then save the file as .xlsx or your preferred Excel-compatible format.

Frequently Asked Questions
Why does =A2-TODAY() show a date instead of a number?
This happens when the result cell inherits a date format. Right-click the result cell, choose Format Cells, and select Number or General to show the day count.
How can I display "Expired" instead of negative days?
Wrap the formula in an IF condition, for example =IF(A2>=TODAY(),"Active until "&A2,"Expired") or use =IF(A2>=TODAY(),DATEDIF(TODAY(),A2,"d")&" days","Expired").
Can I calculate months and days remaining, not just total days?
Yes. Use DATEDIF with the "y", "ym", and "md" units to return years, months, and days separately, and join them with & for a readable result.
What if my expiration date is stored as text?
Formulas such as TODAY() and DATEDIF require a real date value. Retype the date in date format or use DATEVALUE to convert the text to a date before calculating.




