How to Fix INDEX MATCH #N/A Errors for 36- or 60-Month Returns
Question details
The user needs to troubleshoot an INDEX and MATCH formula returning an #N/A error when calculating 36- or 60-month percentage returns.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Calculating long-term percentage returns based on historical data where certain month-end dates might be missing.
- Observed behavior
- The formula evaluates to #N/A because the MATCH function cannot find the exact target date generated by the EOMONTH function within the data array.
Verify that your dataset contains continuous, unbroken date records that cover the entire 36- or 60-month historical period you are calculating, and ensure all dates are formatted as Date values rather than text.
Use IFERROR to Handle Missing Dates Gracefully
Wrap your INDEX MATCH formula in an IFERROR function to replace the #N/A error with a custom text message when exact month-end dates are missing.
The #N/A error appears because the MATCH function is set to exact match (0) but cannot find the precise date calculated by EOMONTH(..., -60). Using IFERROR prevents the error from breaking other dependent calculations.
Click on the cell that currently displays the #N/A error to make it active.
Click into the Formula Bar at the top of the workspace. Type =IFERROR( immediately after the equals sign.
Move your cursor to the very end of the existing formula, type ,"Insufficient data") and press Enter.

Switch to Approximate Match Logic
Change the match_type argument in your MATCH function if your dataset does not contain every single exact month-end date.
Audit the Calculated EOMONTH Dates
Evaluate the EOMONTH function independently to ensure it is generating the date you expect.
Calculate Investment Returns Seamlessly with WPS Spreadsheet
WPS Spreadsheet provides powerful formula auditing tools and full compatibility with Excel functions like INDEX, MATCH, and EOMONTH, helping you calculate complex financial returns and troubleshoot errors without the hassle.
- 1. Open your data in WPS Spreadsheet: Launch WPS Office and open your financial dataset containing the dates and return values.
- 2. Input the calculation: Select the target cell and enter your INDEX MATCH formula. WPS's auto-complete will guide you through the syntax.
- 3. Use Error Checking: If you encounter an #N/A error, navigate to the Formulas tab and click 'Error Checking' to diagnose the missing date reference.
- 4. Apply IFERROR: Use the formula bar to wrap your calculation in an IFERROR function, ensuring a clean and professional financial report.

Frequently Asked Questions
Why does MATCH return #N/A even when the date looks identical in the cell?
Dates in spreadsheets are stored as serial numbers. If one date includes a hidden timestamp (e.g., 12:00 PM) and the calculated EOMONTH date does not, they are not exact matches. Ensure both are formatted purely as dates without time values.
What does the 0 mean in the MATCH function?
The 0 is the match_type argument specifying an 'Exact Match'. It tells the MATCH function to look for the precise lookup value. If it cannot find it, it returns an #N/A error.
How does the EOMONTH function work in return calculations?
EOMONTH(start_date, months) calculates the last day of the month that is a specified number of months before or after a start date. In EOMONTH($N1, -60), it calculates the month-end date exactly 5 years (60 months) prior to the date in cell N1.
Can I use XLOOKUP instead of INDEX MATCH to avoid this error?
Yes, if your software version supports it. XLOOKUP has built-in error handling (the 'if_not_found' argument) and simplified approximate match modes (e.g., match mode -1 to find the next smaller item), which often eliminates the need for combining IFERROR, INDEX, and MATCH.




