How to Sort and Filter Data in Excel with Dynamic Array Formulas
Question details
Match records, return related columns, and extract filtered lists from datasets using modern dynamic array functions.

- Product
- Spreadsheets
- Device & OS
- not provided
- Scenario
- Performing advanced data analysis and reconciliation by dynamically matching lists and filtering out unmatched records.
- Observed behavior
- Dynamically outputs matched records or filters non-matching items into a new range without using manual filters or helper columns.
Ensure your spreadsheet software is updated to a version that supports modern dynamic array formulas, as older versions may not recognize functions like LET, XMATCH, or HSTACK.
Match and Return Related Columns Using LET, XMATCH, and HSTACK
Combine these powerful functions to look up values, validate matches, and combine columns dynamically without needing manual helper columns.
The LET function allows you to define variables within your formula to improve readability and calculation speed. By combining it with XMATCH and HSTACK, you can easily pull matching records from one list and append data from another.
Determine your main data range (e.g., B14:B22) and your comparison list (e.g., E14:E19). Note the columns containing the data you want to retrieve.
Select the top-left cell of your desired output area. Type the formula: =LET(rowId,XMATCH(B14:B22,E14:E19),IF(ISNA(rowId),"",HSTACK(B14:B22,INDEX(F14:F19,rowId),C14:C22)))
Press Enter. The formula will automatically calculate and 'spill' the matched results and combined columns into the adjacent empty cells.

Extract Non-Matching Records Using FILTER and XMATCH
Use the FILTER function combined with XMATCH to instantly return a list of records that do not appear in a specific comparison list.
Master Dynamic Arrays with WPS Spreadsheet
WPS Spreadsheet provides robust support for modern dynamic array formulas, making complex data sorting, filtering, and matching a seamless experience without requiring complex macros.
- 1. Open your dataset: Launch WPS Spreadsheet and open the document containing the lists you need to sort or filter.
- 2. Select the output area: Click on an empty cell where you want the dynamic array results to start spilling.
- 3. Input the dynamic formula: Type the equals sign (=) followed by your desired function (e.g., FILTER or XMATCH).
- 4. Calculate and spill: Select your data ranges, press Enter, and let the software automatically spill the results into the adjacent cells.

Frequently Asked Questions
Why is my dynamic array formula returning a #NAME? error?
This error typically occurs if you are using an older version of the spreadsheet software that does not support newer functions like LET, XMATCH, or HSTACK. Updating your software to the latest version will resolve this.
What causes a #SPILL! error when using the FILTER function?
A #SPILL! error happens when the dynamic array formula needs to output multiple values, but one or more cells in the required output range are not empty. To fix this, locate the cell containing the formula and clear any data in the adjacent cells that are blocking the spill range.
Can I automatically sort the results generated by the FILTER function?
Yes. You can wrap your FILTER formula within the SORT or SORTBY function. For example, =SORT(FILTER(A1:B10, B1:B10>50)) will both filter the data and arrange the spilled results in ascending order automatically.




