The book: files and exercises · Lesson 15 of 24

Lesson 15 exercises: data validation and drop-down lists

Five exercises on data validation and drop-down lists, with the training signups from lesson15.xlsx: typed choices, choices taken from a list, whole numbers from 1 to 40, invalid data and a new choice. You do each exercise in Excel and check here what you get.

Lesson 15. Data validation and drop-down lists

Use the Signups sheet in lesson15.xlsx: the signups for a company's computer training courses.

Files: lesson15.xlsx · solutions: lesson15-solutions.xlsx.

Do each exercise in Excel with the lesson's file, type the result you get here and click Check. You can write numbers any way you like: 1,234.50, 1234.5 or $1,234.50.

At the end of the page you'll find the lesson's Bonus challenge: one more exercise, whose answer isn't in the book. You check it only here.

Exercise 1

In C4:C20 (Level), create a drop-down list with the typed choices Beginner, Intermediate and Advanced.
What do you type in the Source box?
Show the answer

Select C4:C20, Data Validation, Allow: List, Source: Beginner,Intermediate,Advanced, OK.

Click a cell in C4:C20: the arrow of the drop-down list appears next to it, with Beginner, Intermediate and Advanced.

Exercise 2

In B4:B20 (Course), create a drop-down list that takes its choices from the Courses list in column F. What is written in the Source box?
What is written in the Source box?
Show the answer

Allow: List, Source: =$F$4:$F$7 (selected with the mouse, without the Courses heading).

Exercise 3

In D4:D20 (Hours), allow only whole numbers from 1 to 40, with an error message that blocks wrong values, title Invalid hours. Which style do you choose? Type 50 in D12 to try it: what happens?
Which style do you choose?
Type 50 in D12: what happens?
Show the answer

Allow: Whole number, Data: between, Minimum 1, Maximum 40; Error Alert tab, Style: Stop, title Invalid hours. If you type 50 in D12, the message appears and the value doesn't get into the cell.

Exercise 4

Use Circle Invalid Data: how many cells are circled, which ones, and why?
How many cells are circled?
Which ones? (type the cells, for example A1, B2)
Show the answer

3 cells: C6 (Intermediat, with the last letter missing, instead of Intermediate), B8 (Access isn't in the list of courses), D9 (45 hours, more than 40).

Exercise 5

The company adds a new course, Access: type it in F8. Does it appear in the Course column's drop-down list? Why? How do you fix it?
Does Access appear in the Course column's drop-down list?
What Source do you set so that Access gets into the list?
Show the answer

No: the source is $F$4:$F$7, and cell F8 is outside it. To fix it, extend the source to =$F$4:$F$8 (with Apply these changes to all other cells with the same settings), or turn the list of courses into a table and use INDIRECT with the table's name and its column as the source, as in section 15.3: that way new choices are added by themselves.

Bonus challenge

The answer isn't in the book: you check it only here.

Signups sheet, with the original data: management decides that nobody may take fewer than 10 or more than 20 hours. Change the data validation in D4:D20 to Whole number between 10 and 20 and use Circle Invalid Data. Which cells in the Hours column are circled?
Which cells? (type them, for example A1, B2)
Show the answer

Select D4:D20, open Data Validation and set Allow: Whole number, Data: between, Minimum 10, Maximum 20, then OK and Circle Invalid Data. The circled cells are D5, D7, D9, D11: Mike Robinson (8 hours), Louis Marsh (6), Paul Gardner (45) and David Lambert (8). D6 (20 hours) and D8 (10 hours) are not circled: with between, the minimum and the maximum are valid too. If you still have the validations from exercises 1 and 2, you'll also see circles in C6 and B8.