Function Problems

Create Dependent Excel Drop-Down Lists with XLOOKUP and FILTER

Huma Ashraf ChHuma Ashraf Ch Dec 2, 2026 868 views

Question details

Create a drop-down list of building officials or AHJs based on the county associated with a postal code.

Create Dependent Excel Drop-Down Lists with XLOOKUP and FILTER
Product
Microsoft Excel
Device & OS
not provided
Scenario
A user enters a postal code and selects an official whose county matches the postal code.
Observed behavior
The desired list updates to show officials for the county returned by XLOOKUP.
Before you start

Use an Excel version that supports XLOOKUP, FILTER, and dynamic arrays. Prepare postal-code-to-county and county-to-official tables, and store postal codes consistently so leading zeros are preserved.

Solution 1Recommended

Use a spilled FILTER range as the drop-down source

Use this method to update the official choices when the postal code changes, without relying on a PivotTable.

This example uses Excel tables named PostalCodes and Officials, with columns PostalCode and County in the first table and Name and County in the second. Adjust the table names, column names, and cell references to match your workbook.

1
Enter a postal code

Enter the postal code in cell B2. Make sure its value matches the format used in PostalCodes[PostalCode].

2
Look up the county

In cell C2, enter =XLOOKUP(B2,PostalCodes[PostalCode],PostalCodes[County],""). This returns the matching county or a blank if no match is found.

3
Filter the officials

In an empty cell outside any Excel table, such as H2, enter =FILTER(Officials[Name],(Officials[County]=C2)*(C2<>""),""). Leave the cells below H2 clear so the results can spill.

4
Create the drop-down

Select D2, then choose Data > Data Validation. Under Allow, select List and enter =$H$2# in Source. Click OK and select an official from the drop-down.

5
Test the list

Change the postal code in B2 and open the drop-down in D2. Check that it shows officials for the county in C2.

Use a spilled FILTER range as the drop-down source
Using a different worksheet: If the helper range is on another sheet, create a workbook-level name in Formulas > Name Manager, such as OfficialChoices referring to =Sheet1!$H$2#, and use =OfficialChoices as the validation source. Replace Sheet1 with the helper sheet name.
Work with dependent lists in WPS

Build a County-Based Official List in WPS Spreadsheet

In a WPS Spreadsheet version that supports XLOOKUP, FILTER, and spilled-range validation references, use the same lookup and helper-range approach to create a dependent official list.

  1. 1. Open the workbook: Open WPS Spreadsheet and choose Open to select your XLSX workbook. Check that your version recognizes XLOOKUP and FILTER.
  2. 2. Find the county: Enter a postal code in B2 and use XLOOKUP in C2 to find its county from your postal-code table.
  3. 3. Create the helper list: Enter a FILTER formula in an empty cell such as H2 to return official names matching C2. Keep the cells below the formula clear.
  4. 4. Add and test validation: Select the official-choice cell, open Data > Data Validation, and select a list sourced from the helper range. If your WPS version accepts spilled-range references, use the reference for the FILTER results, then test it with another postal code.
Filter official choices by the county associated with a postal codeOpen and edit Microsoft Excel XLSX filesWork with spreadsheet formulas and data validation in one application
microsoft office alternative - wps office

Frequently Asked Questions

Why is my official drop-down blank?

Check that B2 matches a postal code in the source table and that C2 returns a county. Then check that Officials[County] contains the same county value. A blank result is expected when there is no match.

Why does the FILTER formula show a spill error?

Clear any occupied cells below the FILTER formula and place the formula outside an Excel table. The results need an unobstructed range in which to spill.

Can the drop-down source be on another worksheet?

Yes. In Formulas > Name Manager, create a workbook-level name that refers to the spilled range, such as =Sheet1!$H$2#. Then enter that name, for example =OfficialChoices, in the Data Validation Source box.

Will changing the postal code clear an official already selected?

No. Changing B2 updates the available choices, but it does not automatically clear the existing value in D2. Open the drop-down and select an official from the updated list.