How to Filter Excel Data by Multiple Criteria and Dietary Choices
Question details
The user wants to create a dynamic menu search in Excel that filters items based on multiple dietary characteristics and allergens using drop-downs or checkboxes.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Building a dynamic menu search tool to filter food items by specific dietary requirements (e.g., vegetarian, vegan) and exclude selected allergens.
- Observed behavior
- The user needs a way to combine multiple selected allergens and dietary preferences into a single FILTER formula, as combining several conditions using standard methods is proving difficult.
Ensure your data is organized in a structured table format with clear columns for menu items, dietary types, and allergens. Verify that your spreadsheet software supports dynamic array functions like FILTER, BYROW, and LAMBDA.
Use the FILTER Function with Boolean Logic for Multiple Criteria
Apply multiplication (*) for AND conditions and addition (+) for OR conditions within the FILTER function to handle complex dietary selections.
In Excel, the FILTER function can evaluate multiple conditions by using Boolean logic. Multiplying conditions acts as an 'AND' operator (all conditions must be true), while adding conditions acts as an 'OR' operator (any condition can be true).
Create designated cells (e.g., K7, K8, K9) and use the Data Validation feature under the Data tab to create drop-down menus for users to select their required dietary criteria.
Select the top-left cell where you want the results to appear. To filter data where all conditions must be met, use multiplication. For example, enter `=FILTER(B4:G9, (C4:C9=K7)*(C4:C9=K8)*(D4:D9=K9), "none")`.
If a search for 'vegetarian' should also include 'vegan' items, use addition. Modify your formula to include `(C4:C9="Vegetarian")+(C4:C9="Vegan")` within your FILTER array.

Exclude Specific Allergens Using BYROW and COUNTIFS
Use advanced dynamic array functions to filter out menu items that contain any of the user-selected allergens.
Filter Data Effortlessly with WPS Spreadsheet
WPS Spreadsheet fully supports advanced dynamic array functions like FILTER, BYROW, and LAMBDA. You can easily build complex, multi-criteria search tools for menus, inventories, and more, with full compatibility with Microsoft Excel formulas.
- 1. Open your data in WPS Spreadsheet: Launch WPS Office and open your menu or inventory workbook.
- 2. Create drop-down lists: Go to the 'Data' tab, select 'Validation', and set up drop-down menus for your dietary criteria.
- 3. Enter the FILTER formula: Select an empty cell and input your `=FILTER(...)` formula using Boolean logic (* for AND, + for OR).
- 4. Press Enter to view results: Hit Enter, and WPS Spreadsheet will dynamically spill the filtered results into the adjacent cells.

Frequently Asked Questions
Why does my FILTER formula return a #CALC! error?
The #CALC! error occurs when the FILTER function finds no matching records. You can prevent this by adding a default 'if_empty' value at the end of your formula, such as `=FILTER(A1:B10, A1:A10="Vegan", "No items found")`.
Can I use checkboxes to control the FILTER function?
Yes, you can link checkboxes to cells (which will display TRUE or FALSE) and incorporate those cell references into your FILTER formula using the IF function to toggle criteria on or off.
How do I filter by partial text matches instead of exact matches?
To filter by partial text, combine the FILTER function with ISNUMBER and SEARCH. For example: `=FILTER(A2:B10, ISNUMBER(SEARCH("nut", B2:B10)))` will return all items containing the word 'nut'.
Are dynamic array functions like FILTER available in older versions of Excel?
No, the FILTER function is only available in Microsoft 365, Excel 2021, and modern spreadsheet software like WPS Office. Older versions require complex INDEX/MATCH array formulas to achieve similar results.




