Filter an Excel Table into Separate Worksheets by Location
Question details
Create a separate worksheet for each office location that reflects changes to an Azure Active Directory export table.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- An Azure Active Directory export contains employee records and an Office Location column, and the user wants a location-specific view on each worksheet.
- Observed behavior
- Each location worksheet should display matching source records and update when the source table is edited or expanded.
Open the export in an Excel version that supports the FILTER function, such as Microsoft 365 or Excel 2021. Check that the source data is an Excel table with an Office Location column and that location names are consistent.
Use FILTER formulas on location worksheets
Create a dynamic view for each location using the source table and a location value on each sheet.
Click a cell in the source data and select Table Design. Note the Table Name; the example below uses Table1. If the data is not yet a table, select it and choose Insert > Table.
Add a worksheet for a location and enter its exact name, such as Boston, in cell A1. Copy the source column headers into row 2.
In cell A3, enter =FILTER(Table1,Table1[Office Location]=A1,"No matching records"). Replace Table1 or Office Location if your table or column uses a different name.
Create or duplicate a worksheet for each remaining location and change its A1 value. Keep the cells below and to the right of A3 clear so the results can spill into them.

Create location-specific views in WPS Spreadsheets
In a WPS Spreadsheets version that supports FILTER and dynamic arrays, use a formula on each location sheet to display matching rows from a source worksheet.
- 1. Open the export: Open the workbook in WPS Spreadsheets and place the source data on a sheet named Directory. For this example, use columns A through D, with office locations in column C and headers in row 1.
- 2. Add a location sheet: Click the plus button beside the sheet tabs, enter a location name in A1, and copy the source headers into row 2.
- 3. Filter the source rows: In A3, enter =FILTER(Directory!A2:D10000,Directory!C2:C10000=A1,"No matching records"). Adjust the column references and row limit to fit your data, and leave the spill area empty.
- 4. Create additional views: Add a sheet for each other location and repeat the formula with its location name in A1. Refresh or replace the source data when a new export is available; rows beyond the formula's row limit require an expanded range.

Frequently Asked Questions
Will new employees appear on the location sheets automatically?
Yes, if their rows are added to the Excel source table and their Office Location value matches a sheet's A1 criterion. A new Azure Active Directory export must first be imported or refreshed into the source table.
Why does my FILTER formula show #SPILL!?
The result needs an empty area below and to the right of the formula. Clear any existing values or merged cells in that area, and place the formula outside an Excel table.
What happens if a location has no matching records?
Use the third FILTER argument, as in =FILTER(Table1,Table1[Office Location]=A1,"No matching records"), to display a message instead of an empty-result error.
Will Excel create a worksheet for a new location automatically?
No. Add or duplicate a location worksheet and enter the new location in A1. The FILTER formula will then show matching rows from the source table.
Why is FILTER not recognized in my Excel workbook?
FILTER requires a supported Excel version, such as Microsoft 365 or Excel 2021. Check your version under File > Account and use a supported version if the function is unavailable.




