Microsoft Excel 2024 Comprehensive Course — Beginner to Intermediate
X
Excel 2024 Microsoft 365
📗 34 Modules Foundations Data Entry Formatting Formulas Functions Charts Pivot Tables Data Analysis Protection Automation

▼ Module 32: Drop-Down Lists & Data Validation

Data Validation is the tool that transforms an ordinary spreadsheet into a controlled data entry form. Instead of trusting users to type the correct values, you define exactly what is allowed in each cell: a list of options (so users pick instead of type), a number within a range, a date within specific bounds, a text length limit, or a custom formula rule. Combine this with meaningful error messages and input hints, and you eliminate the most common data quality problems before they happen. Drop-down lists are the most visible application — they are found in every professional SA Excel template from payroll systems to inventory forms to leave trackers.

32.1 What Is Data Validation?

Data Validation restricts what a user can enter into a cell. You define a rule; when the user tries to enter something that violates the rule, Excel either alerts them, warns them, or silently accepts it depending on the alert type you choose.

Opening Data Validation

  • Select the cell(s) to validate → Data tab → Data Tools group → Data Validation
  • — or — Alt+A+V+V (keyboard sequence)
  • The Data Validation dialog opens with three tabs: Settings, Input Message, Error Alert

The Three Tabs

TabWhat It Does
SettingsDefines the rule: what type of data is allowed and what criteria it must meet
Input MessageOptional tooltip that appears when the cell is selected — guides the user before they type
Error AlertControls what happens when invalid data is entered — Stop (blocks entry), Warning (allows with a caution), or Information (informs but always allows)

32.2 All Validation Types — The Settings Tab

The Allow dropdown on the Settings tab determines the category of validation rule. Each type reveals its own set of criteria options.

Allow TypeCriteria OptionsSA Use Case
Any value No restriction (default) — but can still have an Input Message Free-text cells with a helpful tooltip but no restriction
Whole number Between, not between, equal to, not equal to, greater than, less than, greater than or equal to, less than or equal to — set minimum and/or maximum Leave days (1–30), age (18–65), quantity (0–9999), employee number (1–99999)
Decimal Same criteria as Whole number but allows decimal values Commission rate (0.00–0.30), salary (5000–500000), percentage (0–100)
List A comma-separated list typed directly, or a range of cells containing the list values Province, department, job title, status, product category — any fixed set of options
Date Between dates, before/after a date, equal to a specific date — can reference cells or use TODAY() Date of birth (before today), contract start date (after 01/01/2020), invoice date (within current year)
Time Between, before, or after a time value Shift start time (06:00–22:00), meeting booking (08:00–17:00)
Text length Between, equal to, greater than, or less than a number of characters SA ID number (exactly 13 characters), postal code (4 digits), SARS tax number (10 digits)
Custom Any Excel formula that returns TRUE (valid) or FALSE (invalid). The most powerful and flexible validation type. Unique values only, conditional rules, cross-cell validation, regex-like checks

Ignore Blank

At the bottom of the Settings tab: Ignore blank — when ticked, blank cells pass validation without triggering an error. Untick if the field is mandatory and must not be left empty.

Apply to All Cells with the Same Settings

Tick "Apply these changes to all other cells with the same settings" to update every cell in the sheet that currently has the same validation rule — useful for updating a rule without reapplying it to each range individually.

32.3 Drop-Down Lists — Creating and Managing

A drop-down list (List validation) is the most commonly used data validation type. Instead of typing, users click the dropdown arrow and select from a predefined list of options — eliminating spelling variations, capitalisation inconsistencies, and invalid entries.

Method 1 — Typed List (Quick but Hard to Maintain)

  1. Select the cells for the dropdown
  2. Data → Data Validation → Settings tab
  3. Allow: List
  4. Source: type the options separated by commas (e.g., Gauteng,Western Cape,KwaZulu-Natal,Eastern Cape,Limpopo)
  5. Tick In-cell dropdown (ticked by default)
  6. Click OK
Limitation: Typed lists are hard to maintain — to add or remove options you must open the Data Validation dialog for every cell that uses the list and retype the source. Use a range-based list instead for anything that may change.

Method 2 — Range-Based List (Recommended)

  1. Type your list values in a column somewhere (e.g., a "Lists" sheet or a separate column): one value per row
  2. Select the cells for the dropdown
  3. Data → Data Validation → Settings tab → Allow: List
  4. Source: click the range selector icon and select the range containing the list values (e.g., =$J$2:$J$11)
  5. Click OK
Range-Based List Advantages:
  • Update the list by simply changing the values in the source range — all dropdowns using that range update automatically
  • The list can be on a different (hidden) sheet — keep it out of the way of users
  • The list can be sorted and easily reviewed without opening the Data Validation dialog

Method 3 — Named Range List (Most Robust)

  1. Type the list values in a column → select the range → click the Name Box → type a name (e.g., Provinces) → Enter
  2. Data Validation → Source: type =Provinces
  3. Named ranges are absolute by nature — the dropdown works correctly even when the formula is copied to other sheets

Drop-Down Lists on a Hidden "Lists" Sheet

Best practice structure:

Sheet "Lists" (hidden from users):
Column A: Province names  — named range "Provinces"
Column B: Department names — named range "Departments"
Column C: Job titles      — named range "JobTitles"
Column D: Status options   — named range "StatusList"

Sheet "Data Entry" (where users work):
Province column uses =Provinces
Department column uses =Departments
Job title column uses =JobTitles

To hide the Lists sheet: right-click tab → Hide
To prevent unhiding: Review → Protect Workbook → Structure

32.4 Dynamic Drop-Down Lists — Lists That Grow Automatically

A static range-based list does not include new items added below the named range. A dynamic list automatically expands as you add items.

Method 1 — Excel Table as Source

  1. Convert the list values to an Excel Table: select the list → Ctrl+T → OK
  2. Name the Table (Table Design tab → Table Name box, e.g., "ProvinceTable")
  3. In Data Validation Source: type the formula =ProvinceTable[Province] (using the Table name and column header)
  4. New items added to the Table are automatically included in the dropdown

Method 2 — OFFSET Formula for a Dynamic Named Range

Create a named range called "DynamicProvinces" with this formula:
=OFFSET(Lists!$A$1, 0, 0, COUNTA(Lists!$A:$A), 1)

• OFFSET starts at A1 on the Lists sheet
• 0, 0 = no row or column offset
• COUNTA(Lists!$A:$A) = height of the range = count of non-blank cells in column A
• 1 = width of 1 column

As you add values to column A on the Lists sheet, COUNTA increases and
the named range automatically expands to include the new values.

Dependent Drop-Downs — Cascading Lists

A dependent dropdown changes its options based on the selection in another cell. Example: selecting a Province in column A changes the available Cities in column B to show only cities in that province.

  1. Create named ranges for each group (e.g., a range named "Gauteng" containing Johannesburg, Pretoria, Ekurhuleni; a range named "WesternCape" containing Cape Town, Stellenbosch, Paarl)
  2. Critical: named range names must exactly match the values in the first dropdown (e.g., if the Province dropdown says "Gauteng", the named range must also be called "Gauteng")
  3. Select the dependent dropdown cells (column B) → Data Validation → List → Source: =INDIRECT(A2)
  4. INDIRECT converts the text value in A2 ("Gauteng") into a range reference (the named range "Gauteng") — the cities dropdown now shows only Gauteng cities when A2 = "Gauteng"
INDIRECT + Named Ranges for Cascading Lists — Requirements:
  • Named range names cannot contain spaces — use underscores instead (e.g., "Western_Cape")
  • If the province list entry has spaces (e.g., "Western Cape"), use: =INDIRECT(SUBSTITUTE(A2," ","_"))
  • The dependent dropdown must be to the right of or below the primary dropdown to reference it correctly

32.5 Input Message — Guiding Users Before They Type

An Input Message is a small tooltip that appears automatically when a user clicks a validated cell — before they enter any data. It is the most effective way to communicate instructions, acceptable formats, or examples directly in the spreadsheet.

Setting Up an Input Message

  1. Data Validation dialog → Input Message tab
  2. Tick "Show input message when cell is selected"
  3. Title: a bold heading for the tooltip (e.g., "SA ID Number")
  4. Input message: the body text (e.g., "Enter the 13-digit SA ID number. Example: 9001155009087. Do not include spaces or hyphens.")
  5. Click OK

Input Message Examples

Cell TypeTitleMessage
SA ID NumberSA ID NumberEnter 13 digits. Example: 9001155009087. No spaces or hyphens.
SalaryMonthly Salary (Rand)Enter gross monthly salary in Rands. Must be between R4,500 and R500,000.
Leave start dateLeave Start DateEnter in dd/mm/yyyy format. Date must be in the future.
Province dropdownProvinceSelect the employee's province of residence from the list.

32.6 Error Alerts — Responding to Invalid Entries

The Error Alert tab controls what happens when a user enters data that violates the validation rule. There are three styles, each with a different level of strictness.

Error Alert Styles

StyleIconEffectWhen to Use
Stop 🛑 Red stop sign Completely blocks invalid entry — the user must enter a valid value or cancel. The invalid value is never accepted. Mandatory fields that must be correct: SA ID, employee number, amounts within a required range
Warning ⚠️ Yellow triangle Shows a warning but allows the user to override by clicking "Yes" to continue anyway Fields where an unusual value is possible but worth flagging: an exceptionally high salary, a date far in the future
Information ℹ️ Blue info circle Shows a message but always accepts the entry — the user is informed but not blocked Soft guidance where the value entered is outside the expected range but not necessarily wrong

Setting Up an Error Alert

  1. Data Validation → Error Alert tab
  2. Tick "Show error alert after invalid data is entered"
  3. Style: choose Stop, Warning, or Information
  4. Title: the heading of the error dialog (e.g., "Invalid SA ID Number")
  5. Error message: a clear description of what went wrong and what is expected (e.g., "The SA ID number must be exactly 13 digits. Please check and re-enter.")
  6. Click OK

Professional Error Alert Examples

ValidationStyleTitleMessage
ID number (exactly 13 chars)StopInvalid ID NumberSA ID numbers must be exactly 13 digits. Please re-enter.
Salary > R200,000/monthWarningUnusual SalaryThe salary entered exceeds R200,000/month. Please verify this is correct. Click Yes to proceed.
Leave days > 30StopLeave Days ExceededMaximum leave per request is 30 days. Please enter a value between 1 and 30.
Contract end before startStopInvalid DateEnd date cannot be before start date. Please check the dates.

32.7 Custom Formula Validation — Advanced Rules

Custom validation allows any Excel formula that returns TRUE or FALSE. If the formula returns TRUE, the entry is valid; FALSE triggers the error alert. This is the most powerful validation type, enabling cross-cell rules and complex data integrity checks.

Custom Validation Formula Reference Rule

Like Conditional Formatting formulas, the formula is written for the top-left cell of the selected range and applies relatively to all other cells. Use column-locked references ($A2) when the rule depends on a column; use fully absolute references ($A$1) for a fixed reference cell.

Essential Custom Validation Formulas

RuleFormula (for cell B2)How It Works
SA ID exactly 13 digits =LEN(B2)=13 TRUE if the entry is exactly 13 characters long
No duplicates in a column =COUNTIF($B$2:$B$200,B2)=1 TRUE if the value appears only once in the range — blocks entry of a value already in the list
End date must be after start date =C2>$B2 (end date in C2, start in B2) Cross-cell rule: C2 must be greater than B2
Email contains @ and . =AND(ISNUMBER(FIND("@",B2)),ISNUMBER(FIND(".",B2))) TRUE if the cell contains both @ and . characters (basic email format check)
SA phone number (10 digits starting with 0) =AND(LEN(B2)=10,LEFT(B2,1)="0") TRUE if exactly 10 characters AND starts with "0"
Percentage between 0 and 100 =AND(B2>=0,B2<=100) TRUE if the value is 0 or above AND 100 or below
Cell must not be blank (mandatory field) =B2<>"" TRUE if the cell is not empty (prevents blank submission)
Numeric only (no text) =ISNUMBER(B2) TRUE if the cell contains a number; FALSE for text
Date in the current year =YEAR(B2)=YEAR(TODAY()) TRUE if the entered date falls within the current calendar year
Value from approved list (dynamic) =COUNTIF(ApprovedList,B2)>0 TRUE if the entered value exists in the named range "ApprovedList" — more flexible than dropdown List type

32.8 Managing, Copying & Removing Data Validation

Copying Validation to Other Cells

  • Paste Special: Copy a cell with validation (Ctrl+C) → select the target cells → Ctrl+Alt+V → select Validation → OK. Pastes only the validation rule, not the cell content or formatting.
  • Regular paste: Ctrl+C → Ctrl+V copies validation along with content and formatting (may not be what you want if the destination already has data).
  • Format Painter: copies validation along with formatting (but not content).

Removing Data Validation

  1. Select the cells to clear
  2. Data → Data Validation
  3. Click Clear All (bottom-left of the dialog) → OK
  4. All validation rules, input messages, and error alerts are removed from the selected cells

Finding All Validated Cells

  • Home → Find & Select → Go To SpecialData validation
  • Choose All to find every validated cell on the sheet, or Same to find only cells with the same rule as the active cell
  • All validated cells are selected — you can then remove or update their validation in one step

Circling Invalid Data

Excel can visually identify cells that already contain data violating the current validation rules (data entered before the rule was applied, or rules added after data was entered):

  1. Data tab → Data Tools group → Data Validation dropdown arrow → Circle Invalid Data
  2. Red circles appear around every cell that currently fails its validation rule
  3. After correcting the data: Data Validation dropdown → Clear Validation Circles to remove the circles

32.9 Practical SA Data Validation Scenarios

HR Employee Capture Form

Field A – Full Name:          Text length > 0 (mandatory)
Field B – SA ID Number:       Custom: =LEN(B2)=13 — Stop — "Must be 13 digits"
Field C – Department:         List: =Departments (named range from Lists sheet)
Field D – Province:           List: =Provinces
Field E – Date of Hire:        Date: between 01/01/2000 and today
Field F – Monthly Salary:     Decimal: between 4500 and 500000 — Warning above 200000
Field G – Contract Type:      List: Permanent,Fixed Term,Contractor,Intern
Field H – Contract End:       Custom: =IF($G2="Permanent",TRUE,H2>$E2)
                                    — Permanent contracts skip date validation; others must end after hire date
Field I – Work Email:          Custom: =AND(ISNUMBER(FIND("@",I2)),ISNUMBER(FIND(".",I2)))

Monthly Timesheet Validation

Hours per day: Whole number between 0 and 24
Overtime hours: Decimal between 0 and 8 — Warning if > 4
Leave type: List: Annual,Sick,Family Responsibility,Unpaid,Study
Date column: Date between start and end of current month:
    Min: =DATE(YEAR(TODAY()),MONTH(TODAY()),1)
    Max: =EOMONTH(TODAY(),0)
Total hours per row: Custom =SUM(C2:AG2)<=240 (max hours in month)

32.10 Quick Self-Check

Q1: You want a Province dropdown in column C of a data entry form. The provinces are already listed in column A of a hidden "Lists" sheet (A2:A9). Write the Data Validation setup steps and the Source value to use.

✓ Select all cells in the Province column (e.g., C2:C200) → Data → Data Validation → Settings tab → Allow: List → Source: click the range selector → navigate to the Lists sheet → select A2:A9 (the province names). The Source box will show =Lists!$A$2:$A$9. Alternatively, if the province range has been named "Provinces" via the Name Box, type =Provinces in the Source field directly (this works even across sheets and is more portable). Click OK. A dropdown arrow appears in each C cell. For a more robust setup: name the range (select A2:A9 on Lists sheet → Name Box → type Provinces → Enter), hide the Lists sheet (right-click tab → Hide), and protect the workbook structure (Review → Protect Workbook) so users cannot unhide and edit the source list.

Q2: You need a cascading dropdown where selecting a Province in column A changes the available Cities in column B. "Gauteng" should show Johannesburg, Pretoria, Ekurhuleni. "Western Cape" should show Cape Town, Stellenbosch, Paarl. How do you set this up?

✓ Step 1 — Create the named ranges: on the Lists sheet, type the Gauteng cities in one range (e.g., D2:D4) and select them → Name Box → type "Gauteng" → Enter. Type the Western Cape cities in another range (e.g., E2:E4) → Name Box → type "WesternCape" → Enter (no spaces allowed in named range names). Step 2 — Province dropdown: set column A validation to List using the Provinces list as normal. Step 3 — City dependent dropdown: select B2:B200 → Data Validation → List → Source: =INDIRECT(SUBSTITUTE(A2," ","_")). The SUBSTITUTE replaces spaces in "Western Cape" with underscores to match the named range "WesternCape". INDIRECT converts the text string into the corresponding named range. When A2 = "Gauteng", the cities dropdown shows Johannesburg, Pretoria, Ekurhuleni. When A2 = "Western Cape", it shows Cape Town, Stellenbosch, Paarl.

Q3: Write a custom Data Validation formula for column B that prevents duplicate values — each entry in B2:B200 must be unique. What error style should you use?

✓ Select B2:B200 → Data Validation → Custom → Formula: =COUNTIF($B$2:$B$200,B2)=1. The formula uses an absolute range ($B$2:$B$200 stays fixed as it applies to each cell) but a relative cell reference for the criteria (B2 shifts to B3, B4, etc. as the rule applies down the column). COUNTIF counts how many times the current cell's value appears in the entire range. =1 means it appears exactly once — valid. If someone tries to enter a value already in the list, COUNTIF returns 2 (or more), the formula returns FALSE, and the error alert fires. Use a Stop error style (red icon) with the title "Duplicate Entry" and message "This value already exists in the list. Each entry must be unique."

Q4: What are the three Error Alert styles in Data Validation, and when would you use each in an SA payroll context?

✓ Stop (red icon): completely blocks invalid entry; user cannot proceed without entering a valid value or cancelling. Use for fields that must be correct — SA ID numbers (must be 13 digits), employee numbers (must be unique), leave days (must be 1–30). An invalid payroll entry that gets through could cause incorrect PAYE calculations or UIF contributions. Warning (yellow triangle): shows a caution but allows the user to override by clicking Yes. Use for unusual but possible values — a salary above R200,000/month is flagged but valid for senior executives; overtime hours above 8 are warned but valid with prior approval. Information (blue circle): informs the user but always accepts the entry. Use for gentle guidance where overrides are routine — noting that a date is outside the standard reporting period but not necessarily wrong.

Q5: You have a spreadsheet with 500 rows of historical employee data. You now add a Data Validation rule requiring all ID numbers to be 13 characters. Some existing ID numbers are wrong. How do you identify which cells violate the new rule without checking each one manually?

✓ After applying the validation rule to the ID column: Data tab → Data Tools group → click the dropdown arrow on the Data Validation button → Circle Invalid Data. Excel draws a red oval circle around every cell in the validated range that currently contains data violating the rule — including all the pre-existing invalid entries that were entered before the rule was applied. Review each circled cell and correct the data. Once corrected: Data Validation dropdown → Clear Validation Circles to remove all circles. This is the professional approach for bulk data auditing — far faster than manually reviewing 500 rows.

Q6: What is the difference between the List validation type using a typed source ("Gauteng,Western Cape,KwaZulu-Natal") versus a range-based source (=Provinces)? Which is better for an SA HR system and why?

✓ Typed source: the values are stored directly in the Data Validation dialog. To add, remove, or edit any province, you must open the Data Validation dialog for every cell using that list and retype the entire source. If 50 cells use the same list, you update 50 dialogs. Range-based source (=Provinces): the values are stored in a range of cells (usually a dedicated hidden Lists sheet) assigned a named range. To update the list, you change the values in the source range once — all 50 dropdown cells automatically reflect the change. For an SA HR system, range-based is clearly better: (1) Lists can change (job titles, departments, cost centres change with restructuring) — one-place updates are essential; (2) The source list can be protected and hidden so only administrators can modify valid options; (3) The list is visible and auditable without opening dialog boxes; (4) Longer lists (all SA municipalities, all bank names, all job grades) are impractical to type as a comma-separated string.

✓ Module 32 Complete — You Have Learned:

  • Data Validation overview — Data tab → Data Validation; 3 dialog tabs (Settings, Input Message, Error Alert); purpose (restrict entries, guide users, prevent errors before they happen)
  • All 8 Allow types — Any value, Whole number (criteria: between/equal/greater etc.), Decimal (same + decimals), List (typed or range), Date (with TODAY() references), Time, Text length (exactly 13 for SA ID), Custom (formula-based); Ignore blank toggle; Apply to same settings cells
  • Drop-down lists — Method 1 (typed comma-separated, quick but hard to maintain); Method 2 (range-based, recommended: update once, reflects everywhere); Method 3 (named range source = most portable, works across sheets); best practice: hidden Lists sheet with named ranges, protected workbook structure
  • Dynamic lists — Excel Table as source (grows automatically); OFFSET+COUNTA formula for dynamic named range; dependent cascading lists with INDIRECT + named ranges (one named range per group, names match first dropdown values exactly, SUBSTITUTE for spaces)
  • Input Message — tooltip shown on cell select; Title + body text; guiding before typing; 4 SA examples (ID, salary, date, province)
  • Error Alert — Stop (red, blocks completely; for mandatory correct fields), Warning (yellow, allows override; for unusual but possible values), Information (blue, always accepts; for guidance only); Title + message for each; 4 professional SA examples
  • Custom formula validation — formula written for top-left cell, applies relatively; 10-formula table (LEN=13, COUNTIF=1 for no duplicates, cross-cell date comparison, email @/. check, phone 10 digits starting 0, AND range, not blank, ISNUMBER, YEAR=current year, COUNTIF on approved list)
  • Managing validation — copy via Paste Special → Validation; clear via Clear All; find all validated cells via Go To Special → Data validation; Circle Invalid Data (highlights pre-existing violations with red ovals); Clear Validation Circles
  • SA scenarios — HR employee capture form (9 fields with appropriate validation types and error styles); monthly timesheet (hours range, leave type list, date within current month using EOMONTH, max hours custom formula)

← Back to All Modules