How to Filter Excel Data by a Larger Group Such as Province
Question details
The user needs to filter records by a larger regional group, such as a province, when the data column contains combined city and province text values.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Organizing and filtering regional data where cities and provinces are combined in single cells (e.g., 'Toronto, ON').
- Observed behavior
- The default filter shows each individual city-province combination instead of allowing the user to filter by the broader province category.
Ensure your data follows a consistent format, such as having a comma and a space before the province abbreviation, to make text filtering and extraction more accurate.
Use the Filter Drop-Down Search Box
The quickest method is to use the built-in search feature within the filter menu to find text containing the specific province abbreviation.
If your dataset already includes the province abbreviation in every cell (e.g., 'Ottawa, ON'), you can leverage the search bar inside the filter menu. This allows you to isolate rows containing that specific text string without modifying your existing data structure.
Select the header of the column containing your city and province data. Go to the 'Data' tab on the top ribbon and click the 'Filter' button to enable drop-down arrows on your headers.
Click the drop-down arrow on the header of your location column.
In the search box located within the filter menu, type the province abbreviation (e.g., 'ON' or 'QC').
Press 'Enter' or click 'OK'. Excel will now display only the records that contain the abbreviation you entered.

Extract the Province into a Separate Column
For better data management, Pivot Tables, and multi-selection filtering, extract the province data into its own dedicated column.
Filter and Manage Large Datasets with WPS Office
WPS Spreadsheet offers advanced filtering, text-to-columns features, and extensive formula support to help you organize combined data seamlessly.
- 1. Open your dataset: Launch WPS Spreadsheet and open the workbook containing your city and province data.
- 2. Enable AutoFilter: Highlight your data headers, navigate to the 'Data' tab, and click 'AutoFilter'.
- 3. Filter or extract: Use the drop-down search box to quickly filter, or use WPS Spreadsheet's text formulas to split your locations into dedicated columns.

Frequently Asked Questions
Can I filter by multiple provinces at the same time using the search box?
No, the search box within the filter menu only allows you to filter by one text string at a time. To filter by multiple provinces simultaneously, it is best to extract the province to a separate column and check multiple boxes in the filter menu.
What if my data doesn't have a comma separating the city and province?
If your data is separated by a space instead of a comma, you can use the 'Text to Columns' feature under the Data tab and choose 'Space' as your delimiter. Alternatively, use a lookup table (VLOOKUP or XLOOKUP) to match city names to their respective provinces.
How do I group these filtered results in a Pivot Table?
To group by province in a Pivot Table, the province data must exist in its own separate column. Once you have used a formula or Text to Columns to separate the province, you can insert a Pivot Table and drag the new 'Province' field into the Rows or Filters area.




