Excel Data Validation: Dropdown Lists, Dependent Dropdowns, Dynamic Ranges, Error Messages, and Input Rules

Excel Data Validation: Dropdown Lists, Dependent Dropdowns, Dynamic Ranges, Error Messages, and Input Rules

Excel Data Validation: Dropdown Lists, Dependent Dropdowns, Dynamic Ranges, Error Messages, and Input Rules

This article is based on procedures personally reproduced and verified in Excel 365, with AI tools used only to assist with draft organization.

1) Basic Dropdowns (Static and Dynamic)

Static List

  1. Data ▸ Data Validation ▸ Allow = List ▸ enter Apple,Pear,Grape,Peach in Source

Dynamic List (Table + UNIQUE/SORT)

  1. Convert the source data to a table (CTRL+T): SalesTbl[Category]
  2. Enter =SORT(UNIQUE(SalesTbl[Category])) in an empty range.
  3. In Formulas ▸ Name Manager, create ddCategory and define it as follows:
    =LET(x, SORT(UNIQUE(SalesTbl[Category])), FILTER(x, x<>""))
  4. For the target cell’s Data Validation, set Source to =ddCategory.

TIP You can also directly reference a spill range with # notation, such as A1#. For more complex setups, use a defined name.

2) Dependent Dropdowns: Category to Item

  1. For the parent selection cell E2, enter the following in the cell where the child list will be created:
    =LET(sel,$E$2, SORT(UNIQUE(FILTER(SalesTbl[Item], SalesTbl[Category]=sel))))
  2. Define the spill range above with the name ddItem.
  3. For the second dropdown’s Data Validation, set Source to =ddItem.

It updates automatically even when the table structure changes. If needed, supplement labels with XLOOKUP.

3) Ten Custom Rules for Real-World Use

PurposeTypeFormula/Setting
Prevent duplicatesCustom=COUNTIF($A:$A,A1)=1
6–12 charactersCustom=AND(LEN(A1)>=6, LEN(A1)<=12)
Numbers only (hyphens allowed)Custom=SUM(--ISNUMBER(--TEXTSPLIT(A1,"-")))=COLUMNS(TEXTSPLIT(A1,"-"))
Basic email patternCustom=AND(ISNUMBER(SEARCH("@",A1)), ISNUMBER(SEARCH(".",A1)))
Disallow weekend datesCustom=WEEKDAY(A1,2)<=5
Past dates onlyDateData = less than or equal to / End date = =TODAY()
Amounts in multiples of 1,000Custom=MOD(A1,1000)=0
Exclude prohibited words from textCustom=ISERROR(SEARCH("prohibited word",A1))
Allow only values in a rangeListInternal list such as =ddCategory
Error-resistant inputCustom=NOT(ISERROR(A1)) — in practice, use with IFERROR

Learning string functions alongside the TEXTSPLIT/TEXTBEFORE/TEXTAFTER guide makes rule design much easier.

4) Input Message and Error Alert UX

  • Input Message: Brief guidance when a user clicks a cell (for example, “Select a category first”).
  • Error Alert: The styles are Stop, Warning, and Information. For training, use Information to encourage correction; for strict control, use Stop.
  • Adding example values to messages greatly reduces mistakes.

5) Troubleshooting Checklist

  • When #SPILL! occurs: Clear the spill range and unmerge merged cells. (Related: Dynamic Array Shaping Toolkit)
  • Remove blank values: Clean up blanks in a list with FILTER(x, x<>"").
  • Rules shift when copied: Use defined names or lock references with absolute references.
  • Table column heading changes: Also update the formula referenced by the defined name.
  • If the list is too long: Combine SEARCH/LEN to create a real-time filter helper cell that narrows the list before connecting it to validation.

6) Follow-Up Exercises and Template Ideas

Exercise A: Three-Level Dependent Dropdown for Region → Store → Staff
  1. Parent: Region (UNIQUE)
  2. Middle: =SORT(UNIQUE(FILTER(Tbl[Store], Tbl[Region]=$E$2)))
  3. Child: =SORT(UNIQUE(FILTER(Tbl[Staff], (Tbl[Region]=$E$2)*(Tbl[Store]=$F$2))))
Exercise B: Combined “Format Validation + Dropdown” Rule

Use a dropdown to enforce default values, then use a Custom formula to validate length and patterns a second time.

Bookmark the finished version, then try turning the rules into templates with LAMBDA next month. (See LAMBDA/MAP/REDUCE.)


Leave a Reply

Your email address will not be published. Required fields are marked *