logo
search
Function Problems

How to Filter Excel Rows for Name and Ranking A or B

Nimra MalikNimra Malik Sep 25, 2026 869 views

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'.

How to Filter Excel Rows for Name and Ranking A or B
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.
Before you start

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.

Solution 1Recommended

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.

1
Open Custom AutoFilter

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.

2
Set the first wildcard condition

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.

3
Add the secondary condition

Select the 'Or' radio button. Set the second drop-down to 'equals' and type 'Name*Ranking B*' in the corresponding text box.

4
Apply the filter

Click OK. The dataset will now display only the rows that start with 'Name' and contain either 'Ranking A' or 'Ranking B'.

Use Custom AutoFilter with Wildcards
Wildcard flexibility: Using wildcards like the asterisk (*) allows you to bypass the two-rule limit in the standard text filter when dealing with compound text structures.
Advanced Data Filtering

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. 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. 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. 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.
Free and lightweight complete office suiteFully compatible with Microsoft Excel (.xlsx) formats and standard formulasIntuitive Custom AutoFilter interface with full wildcard supportBuilt-in advanced text functions like SEARCH, LEFT, and AND/OR work exactly as expected
microsoft office alternative - wps office

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.