Data Validation in Excel: Dropdown Lists, Rules and Error Alerts That Hold

Google Sheets order log with City and Status columns restricted by dropdown validation and an Amount column that rejects negative numbers

Data validation is the difference between a spreadsheet that keeps working and one that quietly falls apart. Anyone who has shared a sheet with five people knows the pattern: one month typed as "January" and another as "1", a city spelled two ways, an amount with "EGP" typed inside the cell. Excel accepts all of it without complaint, and the reports come out wrong with no obvious cause. Validation moves the error prevention into the cell itself.

What data validation does

You decide in advance what may be typed into a cell, and the program rejects anything else. The rule lives inside the cell, not in the head of whoever is typing. That means it still works when someone opens the file who never read your instructions, and it still works when you come back to it in six months.

Validation is not protection

People mix these up. Protection says: do not edit this cell. Validation says: you can type here, but only in this shape. Protection stops people working; validation lets them work and stops the mistake. In an input sheet, put validation on the data columns and protection only on headers and formula cells.

A dropdown list in Excel

  1. Select the range, for example D3:D1000.
  2. Go to Data then Data Validation.
  3. In Allow, choose List.
  4. In Source, type the values separated by commas: New,In progress,Delivered,Cancelled.
  5. Clear Ignore blank if a blank cell should be rejected too.

The picture at the top of this article is a real sheet built this way: the City and Status columns only accept values from their lists, and the Amount column rejects anything below zero.

The same list in Google Sheets

Select the column, then Data then Data validation. Choose Dropdown, type the items one per line, and pick a colour for each if you want the status to be visible at a glance. Sheets also offers "Dropdown from a range", which is the cleaner option once the list is longer than a handful of items.

Use a range instead of typing the list

Typing values inside the rule works until you need to change them, and then you edit every cell you ever validated. Put the values in a separate sheet or a side column and point at them instead: in Excel the source becomes =Lists!$A$2:$A$20, and in Sheets you choose the range with the mouse. The reference must be absolute, which is exactly the point covered in what the dollar sign locks.

One practical detail: keep the list values short and consistent. "In progress" and "in-progress" are different values to every formula in the workbook, so pick one spelling and treat the dropdown as the only place it can be typed.

Input messages and error alerts

A silent rule confuses people. Two fields in the same dialog fix that:

  • Input message: shown when the cell is selected. Write what is expected, for example "Pick a status from the list, do not type it".
  • Error alert: shown when input is rejected. Write what to do instead, for example "Accepted values: New, In progress, Delivered, Cancelled".

A useful sentence starts with a verb: pick, type, check. A useless one says "invalid value" and leaves the person guessing.

Stop or warning

Every rule has a style. Stop blocks the value outright; Warning shows a message but lets it through. Use Stop on anything that feeds a calculation, such as status, city, date and amount, because one bad value pollutes every report downstream. Use Warning on descriptive fields, such as a customer note, where there may be a legitimate reason to break the rule.

Validating numbers

Amount and quantity columns are where reports break most often. A simple "whole number greater than 0" rule blocks negatives and rows that arrived by accident. If there is a sensible ceiling, such as a discount that cannot exceed 30 percent, use "between" and set 0 and 0.3. Watch out for percent cells: the stored value is a decimal, so 30 percent is 0.3, and a rule written as 30 allows a 3000 percent discount.

Validating dates

The "date" rule blocks free text, but it does not block a future date. For a log of completed visits, a future date is a logical error. Use a custom formula instead:

=A3<=TODAY()

That reads: accept the value only if it is today or earlier. Custom formulas are always written relative to the first cell of the selected range, and they move with the rest of the range, so you only need dollar signs if you want to pin the comparison to one cell.

Validating text

Phone numbers and product codes need text rules, not number rules. Three that earn their keep: length equals 11 for a local phone number, begins with a fixed pair of letters for product codes, and does not contain a space for usernames. The "text contains" option is handy for quick checks but does not stop typos: a rule containing "Cairo" also accepts "Cairo East".

Custom formulas worth knowing

  1. Block duplicates in a code column: =COUNTIF($B$3:$B$1000,B3)=1.
  2. Block trailing spaces: =TRIM(B3)=B3.
  3. Tie two fields together: no delivery date unless the status is Delivered, =OR($D3<>"Delivered",E3<>"").

Those three prevent most of the failures that show up in sales reports, and they pair naturally with the conditional sums in the SUMIF guide, because a clean column is what makes those functions trustworthy.

Five reasons validation stops working

  1. The range was wrong, so the rule sits on D3 while people type in D4.
  2. You pasted a cell with no rule over a cell that had one.
  3. A custom formula uses a relative reference to another cell and shifts when copied.
  4. The cell is formatted as text, so a numeric rule never compares anything.
  5. The sheet is partly protected and the editable range excludes the validated cells.

When something fails, check the first cause: select the cell, open the validation dialog, and read the range it actually covers.

Paste bypasses validation

This is the gap most people miss. Pasting into a validated cell can slip a value past the rule, especially when pasting from another program or pasting a whole range at once. After any large paste, audit the column. A quick check: =COUNTIF(D3:D1000,"Delivered")+COUNTIF(D3:D1000,"New")+COUNTIF(D3:D1000,"In progress")+COUNTIF(D3:D1000,"Cancelled"), then compare with the number of non-empty rows. If the two numbers differ, a value escaped the list.

What validation buys your reports

Once status is a closed list, conditional sums stop needing cleanup. Lookups stop failing because one character differs between the search value and the table, which is the everyday reason INDEX and MATCH returns #N/A. Validation removes that possibility at the source.

A checklist before you hand the sheet over

  • Is every column that a human types into validated?
  • Is the rule on the full range, not three cells?
  • Does the error message say what to do?
  • Did you type a bad value yourself and watch it get rejected?
  • Are formula columns protected and input columns open?
  • Did you audit the column after the last big paste?

Six questions, five minutes, and you skip a week of fixing reports. A good sheet is not the one with more formulas. It is the one where the mistake cannot happen in the first place.

Get new guides by email
One short email when a new guide is published. No spam, and you can leave anytime.

Comments

Popular posts from this blog

Excel Formulas for Beginners: 15 Formulas With Examples You Will Use Every Week

INDEX and MATCH in Excel: the lookup that works in both directions

How to Remove Duplicates in Excel: 4 Safe Methods and Fixes When It Finds None