How to Fix #VALUE! Error in Excel FILTER Formula
Question details
The user needs to resolve a #VALUE! error when using the FILTER function to dynamically query an Excel table based on date comparisons.

- Product
- Excel / WPS Spreadsheet
- Device & OS
- not provided
- Scenario
- Filtering an Excel table dynamically using INDIRECT by comparing multiple date columns (MaturityDate, IssueDate, and AsOfDate).
- Observed behavior
- The formula returns a #VALUE! error because the referenced table array includes headers, while the criteria arrays only contain data rows, causing an array size mismatch.
Before troubleshooting your FILTER formula, verify that all table names and column headers referenced in your formula exactly match your actual table design without any hidden spaces.
Use VSTACK to Combine Headers and Filtered Data
Separate the table header from the data rows to ensure array sizes match, then stack them back together using the VSTACK function.
The #VALUE! error occurs when the array you want to filter includes headers (e.g., Table[#All]), but your criteria arrays only contain data rows. Because the arrays have different row counts, the FILTER function cannot map them properly.
Modify your primary INDIRECT reference to target only the table's data rows (e.g., INDIRECT(C12)) instead of the entire table with headers.
Construct the criteria using matching data-only row references: (INDIRECT(C12&"[MaturityDate]") < INDIRECT(C12&"[IssueDate]")) + (INDIRECT(C12&"[MaturityDate]") < INDIRECT(C12&"[AsOfDate]")).
Wrap the data body and criteria in the FILTER function: FILTER(INDIRECT(C12), criteria, "none").
Combine the extracted header row with the filtered results using VSTACK: =VSTACK(INDIRECT(C12&"[#Headers]"), FILTER(...)).

Use LET and XLOOKUP for Cleaner Column References
Simplify your dynamic formula and make it less error-prone by defining variables for headers and columns using the LET function.
Avoid INDIRECT by Pre-Stacking Tables
If you have a known set of tables, you can avoid the volatile INDIRECT function entirely to improve workbook performance.
Easily Manage Array Formulas with WPS Spreadsheet
WPS Spreadsheet fully supports advanced array functions like FILTER, VSTACK, and LET, making it easy to build dynamic reports and resolve array mismatch errors quickly.
- 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your data tables.
- 2. Select the target cell: Click on the cell where you want the top-left corner of the filtered array to appear.
- 3. Enter the VSTACK formula: Type your corrected formula using VSTACK and FILTER to ensure header and data arrays are sized properly.
- 4. Execute the dynamic array: Press Enter to instantly populate the dynamic results across multiple rows and columns.

Frequently Asked Questions
Why does the FILTER function return a #VALUE! error?
The #VALUE! error in the FILTER function typically occurs when the array you are trying to filter and your criteria (include) array have different dimensions, such as a different number of rows.
Can I filter a table by comparing two of its own columns?
Yes, you can compare two columns within the criteria argument of the FILTER function. For example, using (Table1[ColumnA] < Table1[ColumnB]) generates an array of TRUE/FALSE values that FILTER uses to extract the matching rows.
Why should I use VSTACK with FILTER?
Applying FILTER strictly to table data rows excludes the header. VSTACK allows you to combine the standalone header row with your dynamically filtered data rows in a single, clean output.
Is the INDIRECT function slowing down my spreadsheet?
Yes, INDIRECT is a volatile function, meaning it recalculates constantly upon any change in the workbook. Excessive use of volatile functions can negatively impact performance, making alternatives like XLOOKUP or CHOOSECOLS preferable for large datasets.




