fx Data Cleaning

Data Validation dropdowns + dependent dropdowns

⏱ 9 min

What you'll learn

  • Create date, length, whole-number and list validation rules with Stop alerts.
  • Connect a category dropdown to named product ranges using INDIRECT.
  • Audit pasted values and reselect products after changing their category.

Concept

Cleaning is good. Not needing to clean is better.

1. A simple dropdown

  1. Select C2:C100 (Payment Mode column).
  2. Data → Data Validation → Allow: List.
  3. Source: Cash,UPI,Card,Cheque
  4. OK.

Now each cell shows a dropdown arrow, and typing "upi payment" is rejected.

2. Dropdown from a range (better)

Put payment options in Lists!D2:D5, define the workbook name PayModes for that range, then use Source: =PayModes. Named ranges make references to another sheet easy to reuse.

To make the list grow automatically when you add options, convert it to a Table (Ctrl + T) and give it a name via Formulas → Define Name, e.g. PayModes = the table column. Then Source: =PayModes.

3. Other rules

Allow Example rule Stops
Whole number between 1 and 100 qty of 0, 500 or 2.5
Decimal greater than 0 negative prices
Date between 01-04-2026 and 31-03-2027 dates outside the financial year
Text length equal to 10 mobile numbers with 9 or 11 digits
Custom =COUNTIF($B:$B, B2)=1 duplicate entries in column B

4. Input message and error alert

  • Input Message tab: a hint that appears when the cell is selected ("Enter a 10-digit mobile number").
  • Error Alert tab, three styles:
    • Stop — invalid entry is not allowed.
    • Warning — asks "Continue?".
    • Information — just informs, allows it.

Write your own message instead of Excel's default one.

5. Dependent dropdown (INDIRECT method)

Goal: choose Category in A2; the Product dropdown in B2 shows only products from that category.

Step 1 — lists on a sheet named Lists:

A B
1 Electronics Furniture
2 Laptop Chair
3 Mobile Desk
4 Printer Almirah

Step 2 — named ranges. Select A1:B4 → Formulas → Create from Selection → tick Top row. Now Electronics = A2:A4 and Furniture = B2:B4.

Step 3 — first dropdown in A2: define Categories as Lists!$A$1:$B$1, then use List, Source =Categories.

Step 4 — second dropdown in B2: List, Source:

=INDIRECT($A2)

INDIRECT turns the text "Furniture" into the named range Furniture. Copy both cells down.

Rule: range names can't contain spaces. For a category like "Home Decor", name the range Home_Decor and use =INDIRECT(SUBSTITUTE($A2, " ", "_")).

6. Limitations to know

Pasting data into a validated cell bypasses the rule. Validation also doesn't check data entered before it was applied. To find those, use Data → Data Validation (arrow) → Circle Invalid Data.

Changing Category does not automatically clear an already selected Product. Clear and reselect Product, or flag mismatches with a check formula. Text length = 10 checks the number of characters, not whether all characters are digits. Stop alerts apply to typed entries; pasted data and existing values still need an audit. See Microsoft’s validation guidance.

Common mistakes

Typing the list with spaces after commas (Cash, UPI makes " UPI" with a space). Not locking the range with $. Spaces in range names for dependent dropdowns. Assuming validation protects against copy-paste.

Exercises

mediumBuild an entry sheet with: Date (only this financial year), Customer Mobile (exactly 10 characters), Category dropdown, dependent Product dropdown, Qty (whole number 1–100) and Payment Mode dropdown. Add input messages and a Stop alert for mobile numbers.
Build rules on Entry Practice A2:F21. A: Date between DATE(2026,4,1) and DATE(2027,3,31); B: Text Length equal to 10 (format as Text); C: List =Categories; D: List =INDIRECT($C2); E: Whole number 1–100; F: List =PayModes. Enable input messages and Stop alerts. Lists provides the workbook-scoped names Electronics, Furniture, Categories and PayModes. Entry Example has all rules installed for comparison. Try typed quantity 2.5 and an 11-character mobile: reject both. A ten-letter string passes a length-only rule; digit checks need a custom rule. Change Electronics/Laptop to Furniture: clear Product and select Chair, Desk or Almirah. The example’s check column flags the stale selection. Blank unused rows are allowed; pasted data still requires review.

Quiz

Which function makes a dependent dropdown work?
INDIRECT
Which alert style completely blocks invalid entries?
Stop
Does validation stop pasted data?
No
Data Validation dropdowns + dependent dropdowns · Foundations | ExcelWalaa