How to Filter Excel Items by a Selected Group Without Blank Rows
Question details
Dynamically display a list of items belonging to a specific group selected via a dropdown, ensuring no blank rows appear in the results.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A user has a large dataset containing thousands of items assigned to multiple groups. They need to extract a clean, contiguous list of items for a chosen group into another column or sheet based on a data-validation dropdown selection.
- Observed behavior
- When attempting to filter items conditionally using basic IF formulas, blank rows often appear in place of non-matching items. The goal is to achieve a dynamic output that completely skips these empty rows.
Ensure your dataset has clear, distinct column headers for your groups and items. Note that if you are using Excel 2019, modern dynamic array functions like FILTER are unsupported, so you must rely on older formula combinations like INDEX and AGGREGATE or use Power Query.
Use the Dynamic FILTER Function (Microsoft 365)
The most efficient and direct way to extract items without blank rows if your spreadsheet software supports modern dynamic arrays.
The FILTER function automatically spills the results into adjacent cells, removing the need to drag formulas down a column. This solution is ideal for Microsoft 365 or newer spreadsheet applications.
Select the cell where you want users to choose a group (e.g., cell I2). Go to the Data tab, click 'Data Validation', choose 'List' from the Allow dropdown, and select your group headers as the source.
In the first cell of your output column, type the formula: =FILTER(INDEX(B2:G21,,MATCH(I2,B1:G1,0)), INDEX(B2:G21,,MATCH(I2,B1:G1,0))<>""). Adjust the ranges to match your specific dataset.
Hit Enter. The formula will dynamically find the correct group column using MATCH and INDEX, then FILTER out any blank cells, returning a perfectly contiguous list of items.

Extract Items Using INDEX and AGGREGATE (Excel 2019)
A reliable formula combination for older versions of Excel that lack support for dynamic array functions.
Filter Groups Dynamically Using Power Query
Best for extremely large datasets where group structures expand over time and formula performance becomes an issue.
Easily Filter and Manage Data with WPS Office
WPS Spreadsheet offers full support for modern array formulas, including the FILTER function, allowing you to dynamically extract group items without blank rows effortlessly.
- 1. Open WPS Spreadsheet: Launch WPS Office and open your workbook containing the item and group dataset.
- 2. Create a Dropdown List: Select your target cell, go to the Data tab, select 'Validation', and define your list of groups.
- 3. Use the FILTER Function: Type the =FILTER() formula referencing your item array and the condition that matches your dropdown selection while excluding blanks.
- 4. Get Gapless Results instantly: Press Enter. The modern array engine in WPS Spreadsheet will instantly display the filtered data without any blank rows.

Frequently Asked Questions
Why does my basic IF formula leave blank rows?
A standard IF formula evaluates cells row by row. If a condition isn't met, it returns the specified 'false' value (usually an empty string ""). It does not compress or skip the physical row in the spreadsheet, resulting in gaps in your list.
Can I use VLOOKUP to return multiple items without blanks?
No, the VLOOKUP function is designed to return only the first matching record it encounters. To return multiple items dynamically, you must use the FILTER function, or a combination of INDEX and AGGREGATE/SMALL.
How do I make the dropdown menu update automatically when new groups are added?
To make your data validation dropdown dynamic, format your source group headers as a structured Excel Table, or define a dynamic named range using the OFFSET and COUNTA functions. When you point your data validation list to this dynamic range, it will update automatically.




