Function Problems

How to Return All Matching Rows in WPS Office Spreadsheets with XLOOKUP Alternatives

Amos GikundaAmos Gikunda Nov 13, 2026 870 views

Question details

The user needs to return every task table row whose task code matches a requested code, instead of only the first match returned by XLOOKUP.

How to Return All Matching Rows in WPS Office Spreadsheets with XLOOKUP Alternatives
Product
WPS Office Spreadsheets
Device & OS
not provided
Scenario
Working with a task database where multiple rows can share the same task code and the user wants all matching records for each requested code.
Observed behavior
XLOOKUP returns only the first match, leaving additional matching rows unreported.
Before you start

Confirm that the task data and request codes are in separate WPS Spreadsheets tables with consistent headers, and that the task code column names match the formula or Power Query join fields.

Solution 1Recommended

Stack all matching rows with FILTER and REDUCE

Use this formula-based method when you need a dynamic spill range that automatically returns every matching task row for each requested code.

XLOOKUP normally stops at the first match. Wrapping FILTER inside REDUCE lets WPS Spreadsheets evaluate each unique requested task code separately and stack the matching rows into one dynamic array.

1
Format both ranges as tables

Select the data range in WPS Spreadsheets, go to Insert > Table, enable My table has headers, and name the tables TaskData and Requests.

2
Click the spill start cell

Click an empty cell where the returned header and rows should appear.

3
Enter the REDUCE/FILTER formula

Type =REDUCE(Header,UNIQUE(Requests[Requested Work TASK CODE]),LAMBDA(acc,code,LET(matches,FILTER(TaskData,TaskData[Task Code]=code,code),VSTACK(acc,EXPAND(matches,,10,"Not Found"))))). Replace Header with the actual header range or a named range.

4
Press Enter and check the spill

Press Enter and confirm WPS Spreadsheets fills all matching rows below the header.

Stack all matching rows with FILTER and REDUCE
All matches returned: The dynamic array stacks matching rows for every unique requested code and adds a placeholder when no match exists.

Return every matching row with WPS Office Spreadsheets

Use WPS Office Spreadsheets to combine FILTER, REDUCE, and Power Query so every matching task row is returned instead of only the first XLOOKUP result.

  1. 1. Open workbook in WPS Office Spreadsheets: Open the workbook containing the TaskData and Requests tables in WPS Office Spreadsheets.
  2. 2. Enter the FILTER/REDUCE formula: Click an empty cell, enter =REDUCE(Header,UNIQUE(Requests[Requested Work TASK CODE]),LAMBDA(acc,code,LET(matches,FILTER(TaskData,TaskData[Task Code]=code,code),VSTACK(acc,EXPAND(matches,,10,"Not Found"))))), and press Enter.
  3. 3. Review the spilled rows: Confirm all matching task rows appear under the header row.
  4. 4. Refresh with Power Query if needed: For a refreshable result, go to Data > From Table/Range, merge the two queries with a left outer join, expand the matching rows, and choose Close & Load.
Return all matching rows for each requested task code with dynamic array formulasOpen and edit .xlsx files with Excel-compatible functions and formula syntaxUse Power Query merge for a refreshable, no-formula alternativeWork in a familiar Office ribbon without changing your current task workbook
microsoft office alternative - wps office

Frequently Asked Questions

Why does XLOOKUP return only one row when multiple rows match?

XLOOKUP is designed to return the first match it finds. To return every matching row, use a dynamic array formula such as FILTER inside REDUCE, or merge the request and task tables with a Power Query left outer join.

Does the REDUCE/FILTER formula work in WPS Office Spreadsheets?

Yes. Open the workbook in WPS Office Spreadsheets, make sure the requests and task data are Excel tables, and enter the formula in an empty area. WPS Office Spreadsheets supports dynamic array functions when your version is up to date.

How do I get the formula to work when table headers are not named Header?

Replace the Header argument with the actual header range, such as TaskData[#Headers], or define a named range named Header before entering the formula.

What is the Power Query step for returning all matching rows?

Load both tables with Data > From Table/Range, use Home > Merge Queries > Merge Queries as New, set the join kind to Left Outer, and then expand the matching task columns before using Close & Load.