Lesson 15 / 15100%

Lesson 15

Data Validation and Drop-down Lists

14 min

Secure data entry and build reliable tracking forms.

Definition

Data validation is an Excel feature that defines which values areallowed to be entered in a cell: a choice from a list, a number within a range, a date within a period, a text of a given length, or any custom condition. When an entry does not follow the rule, Excel can reject it or warn the user, which prevents errors before they enter the table.

Why secure data entry

When a workbook is filled in by several people (a tracking form, a file shared across a team), entry errors quickly become common: typos, inconsistent values, impossible dates.Data validation prevents incorrect values from being entered at the source.

The consequences of a bad entry often go beyond the cell concerned. A status written as "Done", "Finished" and "Complete" depending on who types it breaks a filter or a PivotTable by splitting what should be a single group; an amount entered with text makes a sum fail; an impossible date skews a lead-time calculation. It is much easier to prevent the error at entry than to fix it afterwards across hundreds of rows.

Creating a drop-down list

The most common case: forcing the user to choose from a predefined list of values, rather than typing text freely.

drop-down-list.txt
1. Select the relevant cell or cells
2. Data tab > Data Validation
3. Allow: "List"
4. Source: either type the values separated by commas
   (e.g. Open,In progress,Closed)
   or select a range of cells that already contains these values

In the English version of Excel, values typed directly into the "Source" field are separated by a comma , (depending on your regional settings, Excel may expect a semicolon instead). For a long list, or one likely to change, it is better to enter the values in a range of cells (ideally on a dedicated sheet) and point the source to that range: when you edit the range, all the drop-down lists that use it are updated. Make sure to leave the "In-cell dropdown" option checked, otherwise the small arrow does not appear.

Data validation and drop-down lists in Excel

Restricting to a type or a range of values

Beyond lists, data validation lets you restrict entry according to other precise criteria.

  • Whole number / decimal — with a minimum and a maximum (e.g. an age between 0 and 120).
  • Date — within a specific range (e.g. it is impossible to enter a date earlier than today).
  • Text length — useful, for example, to force a postal code to 5 characters.
  • Custom formula — any logical condition built by hand.
validation-formula.txt
"Custom" validation formula to allow only a positive amount:
=A2>0

To allow a date only if it is in the future:
=A2>=TODAY()

As with conditional formatting, the custom formula is written from the point of view of thefirst cell of the selected range, then adapts to the other cells through relative references. It must return TRUEfor the entry to be accepted. You can use the logical functions covered earlier in it, for example AND to require several conditions at once.

validation-advanced-formulas.txt
A number between 1 and 100 (formula equivalent to the predefined rule):
=AND(A2>=1, A2<=100)

Forbid duplicates in column A (range A2:A100 selected):
=COUNTIF($A$2:$A$100, A2)=1

Allow entry in B2 only if A2 is filled in:
=A2<>""

Customizing help and error messages

In the same validation dialog, two additional tabs let you improve the data-entry experience:

  • Input Message — a tooltip that appears as soon as the cell is selected, to guide the user before they even enter a value.
  • Error Alert — a custom message displayed if an invalid value is entered, with 3 levels: Stop (blocks entry completely), Warning (warns but allows the user to continue), Information (a simple note).

A good error message clearly says what is expected, not just what is forbidden. Instead of "Invalid value", write for example "Enter a whole number between 1 and 100". The user immediately understands how to fix their entry, without having to contact you. The "Stop" level suits strict rules, whereas "Warning" is useful when an exception remains possible.

Help and error messages in Excel

A few common use cases

Data validation has its place in almost every shared workbook. Here are typical situations where it prevents many errors.

  • Project tracking — a drop-down list for status and priority guarantees identical values for everyone, and therefore reliable filters and PivotTables.
  • Purchase order — a quantity limited to a positive whole number avoids absurd negative or decimal values.
  • Schedule — a range of allowed dates prevents entering a past date or a wrong year.
  • Customer record — a fixed text length for the postal code or the phone number immediately detects missing digits.

In the validation dialog, the "Ignore blank" checkbox determines whether a cell left empty is accepted. Leave it checked for an optional field, and uncheck it if the entry must be filled in.

The limits of data validation

Validation is an effective safeguard, but it is not foolproof. It is important to know its limits so as not to trust it blindly.

  • Copy-paste bypasses it — pasting a value from another cell replaces the rule of the destination cell, with no check at all.
  • Existing data is not checked — a rule added after the fact does not correct what has already been entered.
  • It does not protect the cell — to prevent any modification, you must also lock the cell and protect the sheet.

To spot invalid values that are already present, use Data > Data Validation > "Circle Invalid Data": Excel draws a red circle around each cell that does not follow the rule. To remove a rule that is no longer needed, open the same dialog and click "Clear All".

Dependent drop-down lists (advanced)

A more advanced technique is to make the content of a drop-down list depend on the choice made in another cell — for example, first choosing a country, then displaying only the cities of that country in the second list. This generally relies onnamed ranges combined with the INDIRECT function.

dependent-list.txt
Named ranges: "France" (list of French cities), "Spain" (list of Spanish cities)

Cell A2: drop-down list containing the countries (France, Spain)

Cell B2: Validation > List, Source:
=INDIRECT(A2)

→ if A2 contains "France", the list in B2 displays the cities from the named range "France"

The INDIRECT function turns text into a reference: here, the content of A2 is interpreted as the name of a range. For this to work, the name of each range must exactly match a value of the first list, and must not contain spaces.

Building a reliable tracking form

By combining everything you have learned in this course — formatting, formulas, drop-down lists and validation — you can build a real tracking form: a table where each column enforces its own format and its own rules, drastically reducing everyday data-entry errors.

An effective method: first turn your range into an Excel Table so that the validation rules carry over to new rows, then apply a validation suited to each column (a list for the status, a date for the deadline, a whole number for the quantity), add conditional formatting to highlight delays, and finish with a total row. You get a tool that other people can fill in without any risk of breaking it.

Course wrap-up

You now master the whole Excel learning path: from data entry to advanced analysis with PivotTables, including conditional formulas and charts. That is enough to be autonomous on the vast majority of everyday office tasks.

Exercise

Add a drop-down list to a "Status" column (for example: To do, In progress, Done) in one of your existing tables. Test it by trying to enter a value that is not in the list, and check that the error message is displayed properly.

Going further

Add a validation to a "Quantity" column that only allows positive whole numbers, with an explanatory input message and a custom error message for an incorrect value. Then create a "Custom" formula validation that forbids duplicates in a column of references, and finally use "Circle Invalid Data" to check a table that is already filled in.