Office Settings & Configuration

Use a Formula with an Excel Data Validation Drop-Down

Muhammad TalhaMuhammad Talha Dec 2, 2026 870 views

Question details

Determine how to combine a drop-down list with formula-based control over permitted entries in Excel.

Use a Formula with an Excel Data Validation Drop-Down
Product
Microsoft Excel
Device & OS
not provided
Scenario
The user wants a cell to offer a drop-down list while restricting entries according to a formula.
Observed behavior
The desired result is a drop-down whose permitted values follow a formula-based condition.
Before you start

Decide whether you need a visible drop-down or an independent custom validation formula. A single Excel cell can have one data validation type, so a List rule and a separate Custom rule cannot both be applied to it.

Solution 1Recommended

Create a formula-driven validation list in Excel

Use a formula to build the permitted values in a helper range, then use that range as the drop-down source.

This example uses FILTER and a spilled range, available in Excel versions that support dynamic arrays. The formula controls the list contents; it is not a separate Custom validation rule.

1
Prepare the source data

In a worksheet, enter possible values in A2:A20 and their status in B2:B20. Mark permitted rows as Active.

2
Create the filtered list

In an empty cell such as D2, enter =FILTER(A2:A20,(B2:B20="Active")*(A2:A20<>""),""). Leave the cells below D2 clear so the results can spill.

3
Set up the drop-down

Select the entry cell, such as F2, and open Data > Data Validation. On the Settings tab, set Allow to List, enter =$D$2# in Source, and make sure In-cell dropdown is selected.

4
Reject invalid entries

In Data Validation, open the Error Alert tab, select Show error alert after invalid data is entered, and choose Stop. Click OK, then test F2 with a listed value and an unlisted value.

Create a formula-driven validation list in Excel
Check empty results and pasted values: If no rows meet the condition, the example formula returns an empty result rather than a usable list. Data validation is not a complete security control: pasted or filled values can bypass its normal entry checks.
Formula-driven lists in WPS Spreadsheets

Build a formula-backed validation list in WPS Spreadsheets

Use helper cells to calculate permitted entries, then use those cells as the source for a WPS Spreadsheets validation drop-down. Empty helper results may appear as blank list items.

  1. 1. Prepare the source data: Open the workbook in WPS Spreadsheets. Enter candidate values in C2:C10 and their status in B2:B10.
  2. 2. Calculate permitted values: In A2, enter =IF(B2="Active",C2,"") and fill the formula down through A10. Rows not marked Active return an empty result.
  3. 3. Create the list: Select the entry cell and open Data > Data Validation, which may be labeled Validity in some versions. Choose List, set the source to =$A$2:$A$10, and enable the in-cell drop-down if that option is available.
  4. 4. Set the alert and test: In the validation dialog, enable the error alert and choose Stop if available. Click OK, then test the drop-down and an unlisted entry; check for blank items from the helper range.
Use formulas in a helper range to update drop-down source valuesOpen and edit Microsoft Excel XLSX and XLS filesWork with a familiar spreadsheet interfaceUse WPS Office for free
microsoft office alternative - wps office

Frequently Asked Questions

Can I apply both List and Custom validation to the same Excel cell?

No. A cell has one data validation rule. To keep the drop-down, use a formula-driven source range with Allow set to List; to use an independent formula, choose Allow: Custom instead.

How do I stop users from typing a value that is not in the list?

Select the cell and open Data > Data Validation. On the Error Alert tab, enable the alert and choose Stop. Note that pasting or filling cells can bypass normal validation checks.

Why does the filtered drop-down show no usable values?

Check that at least one source row meets the FILTER condition and that the spill range below the formula is clear. The example formula returns an empty result when there are no matching rows.

What can I use if my Excel version does not support FILTER?

Create a helper range with formulas supported by your version, or maintain the permitted values in a separate range. Then select the entry cell and use Data > Data Validation > List to point to that range.