Fix #VALUE! Error with Spilled Array Named Ranges in Excel
Question details
The user is encountering a #VALUE! error when combining SMALL, COUNTIF, and FILTER functions with a named range that points to a dynamic spilled array.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Passing a named range containing a spilled FILTER array into COUNTIF and SMALL functions for data analysis.
- Observed behavior
- The formula returns a #VALUE! error when using the named range, but successfully computes when the spilled array is referenced directly in the formula.
Before troubleshooting dynamic array formulas, verify that you are using a version of Excel that supports dynamic arrays (such as Microsoft 365 or Excel 2021) and create a backup of your workbook.
Reference the Spilled Array Directly Using the Spill Operator
Bypass the named range entirely and use the spill operator (#) to reference the dynamic array directly within your COUNTIF and SMALL functions.
Certain functions like COUNTIF require explicit range references to calculate properly. When a named range fails to preserve the dynamic nature of a spilled array, passing it into these functions triggers a #VALUE! error. Directly referencing the anchor cell using a spill operator (#) resolves the ambiguity for the calculation engine.
Find the specific cell where your FILTER function is entered. This is the top-left cell of your spilled array (e.g., cell A2).
In your COUNTIF or SMALL formula, replace the text of the named range with the anchor cell reference immediately followed by the hash symbol (e.g., A2#).
Press Enter to apply the updated formula. The #VALUE! error should disappear and the correct calculation will be displayed.
Redefine the Named Range with the Spill Operator
Update the named range in the Name Manager so that it explicitly captures the entire dynamic array rather than just a static set of cells.
Handle Dynamic Arrays Seamlessly in WPS Spreadsheet
WPS Spreadsheet offers powerful support for modern array formulas, including FILTER, COUNTIF, and SMALL. You can easily manage spilled arrays and complex data calculations without running into frustrating #VALUE! errors.
- 1. Open your dataset in WPS Spreadsheet: Launch WPS Office and open your workbook containing the data you want to filter and analyze.
- 2. Create a dynamic array: Enter your FILTER formula into a cell to generate a dynamic spilled array.
- 3. Reference using the spill operator: Inside your COUNTIF or SMALL functions, simply type the anchor cell reference followed by '#' (e.g., C2#) to dynamically reference the entire array.
- 4. Use the Name Manager: Alternatively, go to the Formulas tab, open Name Manager, and define your named ranges with the spill operator for cleaner formulas.

Frequently Asked Questions
Why does COUNTIF return a #VALUE! error with a spilled array named range?
COUNTIF requires a literal range reference to operate properly. If a named range does not explicitly pass a valid dynamic reference (by missing the spill operator), COUNTIF cannot evaluate the varying size of the array, resulting in a #VALUE! error.
What is the spill operator (#) in spreadsheet formulas?
The spill operator (#) is placed immediately after an anchor cell reference (e.g., B2#). It instructs the spreadsheet engine to include the entire dynamic array originating from that cell, no matter how many rows or columns it currently occupies.
Does the FILTER function automatically update named ranges?
No, standard named ranges pointing to fixed cell coordinates will not expand alongside FILTER results. You must define the named range using the anchor cell and the spill operator so it resizes dynamically with the output.




