How to Fix Excel DATE Formula #NUM! Error in Strict Open XML Files
Question details
Users encounter a #NUM! error when using a zero value for the day argument in an Excel DATE formula.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Calculating the last day of a previous month using the DATE function with a 0 day argument inside a Strict Open XML workbook.
- Observed behavior
- Excel returns a #NUM! error instead of calculating the appropriate date when the file is saved as a Strict Open XML Spreadsheet.
Verify that your workbook is saved specifically in the 'Strict Open XML Spreadsheet' format and check if your DATE formulas rely on '0' as the day argument.
Use Direct Date Subtraction (Recommended Workaround)
Instead of relying on a 0 day argument to find the last day of the previous month, subtract days directly from a known date cell.
In standard Excel files, entering '0' for the day in a DATE function naturally returns the last day of the preceding month. However, Strict Open XML validation rules reject this, causing a #NUM! error. Subtraction bypasses this limitation.
Click on the cell that displays the #NUM! error containing your DATE function.
Remove the zero-day DATE formula and replace it with a direct subtraction method, such as =A1-1 (where A1 is the first day of the current month).
Press Enter. The cell will now display the previous day's date accurately without triggering a format-specific error.

Utilize the EOMONTH Function
Replace the DATE function entirely with the EOMONTH function, which is specifically designed to handle end-of-month calculations without strict validation conflicts.
Save as Standard Excel Workbook (.xlsx)
Converting the file back to the standard Excel format disables the Strict Open XML validation rules that cause the error.
Use WPS Office to Avoid Strict Format Formula Limitations
If strict format validation bugs in Microsoft Excel are disrupting your workflow, consider switching to WPS Spreadsheet. It offers a highly compatible, lightweight, and completely free alternative that evaluates complex formulas reliably.
- 1. Download WPS Office: Visit the official WPS website to download the free WPS Office suite for your operating system.
- 2. Install and Launch: Follow the simple installation prompts, then open the WPS Spreadsheet application.
- 3. Open Your Spreadsheet: Load your Open XML file. WPS Spreadsheet will automatically handle the standard formula logic without triggering strict validation errors.

Frequently Asked Questions
Why does the DATE function return a #NUM! error only in Strict Open XML files?
Strict Open XML applies rigorous data validation standards that standard Excel files do not. It flags the '0' day argument in a DATE function as technically invalid, returning an error, even though it is a common shorthand for finding the last day of the previous month.
What is the purpose of using 0 as a day in the DATE function?
Setting the day argument to 0 is a widely used trick among Excel users to force the formula to return the last day of the preceding month automatically.
Can I use negative numbers in the DATE function?
Yes, using negative day numbers works without triggering the #NUM! error in Strict Open XML files. However, you must carefully adjust your month arguments to ensure the calculation logic remains accurate.
How do I know if my file is saved as a Strict Open XML Spreadsheet?
You can verify the format by going to 'File' > 'Save As'. Look at the 'Save as type' dropdown box; if it reads 'Strict Open XML Spreadsheet (*.xlsx)' instead of the standard 'Excel Workbook (*.xlsx)', the strict formatting rules apply.




