How to Extract Excel Rows When Specific Columns Contain Values
Question details
The user needs to extract complete rows of data to a separate worksheet if any cell within a specific range of columns (G through J) contains a value greater than zero.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Filtering and extracting matching records automatically to an empty destination worksheet without using SQL.
- Observed behavior
- The user wants the matching records to spill dynamically into the new sheet, avoiding simple sums and bypassing complex database queries.
Verify the exact file name, worksheet name, and cell range of your source data before applying the formula, and ensure the destination area has enough empty space to accommodate the extracted rows.
Use Dynamic Array Formulas (LET and FILTER)
Use modern dynamic array functions to automatically evaluate multiple columns and extract matching rows into a new worksheet.
By combining functions like LET, FILTER, BYROW, and CHOOSECOLS, you can create a powerful formula that checks if any value in columns G through J is greater than zero, and spills the corresponding full row (Columns A through X) to your destination.
Open your destination worksheet and click on cell A2 (or the top-left cell where you want the extracted data to begin).
Type the following formula: =LET(rng,'[testing-5.xlsx]report'!$A$2:$X$23,FILTER(IF(rng="","",rng),BYROW(CHOOSECOLS(rng,7,8,9,10),LAMBDA(a,SUM(--(a>0))>0))))
Replace '[testing-5.xlsx]report'!$A$2:$X$23 with the actual workbook name, worksheet name, and data range of your source file.
Press Enter. The matching rows will automatically spill into the adjacent cells downwards and rightwards.

Filter Rows Using Power Query
Use Power Query as a robust, no-code alternative if your data requires regular automated refreshing.
Effortlessly Extract Data with Dynamic Arrays in WPS Spreadsheet
WPS Spreadsheet fully supports advanced array formulas like FILTER, allowing you to instantly extract and manage complex datasets across multiple columns without writing SQL or VBA code.
- 1. Open your dataset: Launch WPS Spreadsheet and open the workbook containing your source data.
- 2. Prepare destination sheet: Create a new worksheet where you want the filtered rows to appear.
- 3. Apply the FILTER formula: Select the first cell (e.g., A2) and input your combined FILTER and logical criteria formula.
- 4. Spill the results: Press Enter to dynamically populate the rows. The data will automatically update if the source values change.

Frequently Asked Questions
Why does my dynamic array formula return a #SPILL! error?
A #SPILL! error occurs when there is existing text, data, or merged cells blocking the space where the formula needs to expand. To fix this, clear all cells below and to the right of your formula cell.
How do I change which columns the formula checks?
You can modify the column index numbers in the CHOOSECOLS(rng, 7, 8, 9, 10) section of the formula. For example, to check columns B and C, change the numbers to 2, 3.
Can I use these formulas in older versions of Excel like Excel 2016 or 2019?
No, functions like BYROW, CHOOSECOLS, and LET were introduced in Microsoft 365. For older versions, you must use alternative methods such as Power Query, advanced filters, or complex INDEX/AGGREGATE array formulas.




