← Level 4 – Sorter

9 / 12 ⏱ 19 minutes 高级版

A dropdown list

Only what's on the list can go into the cell.

Preventing is better than cleaning up

Cleaning up data takes work. It’s better if mistakes never happen at all. You can set things up so that only what’s on a list can go into a cell. This is called data validation.

Then a classmate can’t type Sandwich or sandwhich. They pick sandwich from the list.

A dropdown list

  1. On the Answers sheet, select B2:B21.

  2. Click Data → Data validation → Add rule.

  3. Under Criteria, choose Dropdown (from a range).

  4. For the range, type Survey!A2:A6 (the list of snacks).

  5. Under Advanced options, choose Reject the input. Click Done.

Now each cell has a little arrow. When you click it, you pick an answer from the list.

In Excel: Data → Data Validation → Allow: List.

Try it

Try typing Sandwich into B3. The spreadsheet rejects it. Pick sandwich from the list.

💡

Now that column B will only have correct answers, you don’t really need the cleanup column C anymore. But it’s fine to keep it.

Grades only from 1 to 5

  1. On the Grades sheet, select B2:B6.

  2. Data → Data validation → Add rule.

  3. Criteria: Is between, 1 and 5. Reject the input. Done.

  4. Try typing 7. It won’t let you.

轮到你了 💪

  1. Answers are picked from a list.
  2. Only 1 to 5 can go into the grades.
  3. You tried typing a wrong value and the spreadsheet rejected it.
✅

Done when: only correct data can go into the important cells.

What to take away from this lesson