How to Filter Excel Rows for Name and Ranking A or B
Question details
The user needs to filter text values in Excel that begin with the word 'Name' and also contain either 'Ranking A' or 'Ranking B', without accidentally matching unrelated cells that only contain the generic word 'ranking'.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Filtering a dataset based on complex, combined text-matching criteria involving both prefix requirements and multiple exact string inclusions.
- Observed behavior
- Using standard basic filters often matches unrelated cells containing generic words. Advanced logic is needed to isolate only the exact starting text combined with specific contained text.
Ensure your dataset has clear column headers and no merged cells within the target range, as merged cells can cause incomplete or inaccurate filtering results.
Use Custom AutoFilter with Wildcards
Best for straightforward filtering where conditions can be combined directly within the built-in Custom AutoFilter tool using wildcard characters.
The standard Excel Custom AutoFilter dialog limits you to two conditions. By using the asterisk (*) wildcard, you can combine the 'begins with' and 'contains' logic into single criteria lines.
Select the header row of your data, navigate to the Data tab on the ribbon, and click the Filter icon. Click the drop-down arrow on your target column, select Text Filters, and choose Custom Filter.
In the Custom AutoFilter dialog, set the first drop-down to 'equals'. In the text box next to it, type 'Name*Ranking A*'. This tells Excel to find cells starting with Name, followed by any characters, and then Ranking A.
Select the 'Or' radio button. Set the second drop-down to 'equals' and type 'Name*Ranking B*' in the corresponding text box.
Click OK. The dataset will now display only the rows that start with 'Name' and contain either 'Ranking A' or 'Ranking B'.

Create a Helper Column Using SEARCH and Logical Functions
Ideal for highly complex filtering rules that exceed standard AutoFilter limitations or when you need reusable filter toggles.
Easily Filter Complex Data with WPS Spreadsheet
WPS Spreadsheet provides a highly compatible and user-friendly interface for handling complex data filters, advanced logical formulas, and helper columns seamlessly.
- 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your existing Excel workbook containing the text data you need to filter.
- 2. Apply Custom Text Filters: Highlight the header row, navigate to the Data tab, and click Filter. Click the drop-down arrow on your target column and select Text Filters > Custom AutoFilter.
- 3. Use wildcards or insert formulas: Enter your combined criteria using asterisks (e.g., Name*Ranking A*) directly into the filter dialog, or utilize the formula bar to quickly build a logical helper column.

Frequently Asked Questions
Why does my filter show cells that just say 'ranking'?
If you use a basic 'Contains: Ranking' filter, the spreadsheet matches any cell containing that standalone word. To fix this, you must specify the exact phrases 'Ranking A' or 'Ranking B' in your filter criteria, or use an exact text search formula.
Can I use regular expressions (Regex) in standard filters?
Standard spreadsheet filters do not support Regular Expressions (Regex). You must rely on standard wildcards like the asterisk (*) for multiple unknown characters, or the question mark (?) for single unknown characters.
How do I filter by more than two conditions in a single column?
The standard Custom Filter dialog is limited to two criteria using AND/OR operators. For three or more conditions, you should use the Advanced Filter feature or create a helper column with a nested OR formula and filter that column for TRUE.




