Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Contingent Validation Lists.

Contingent Validation Lists

Written by Allen Wyatt (last updated August 15, 2022)
This tip applies to Excel 97, 2000, 2002, and 2003


The data validation capabilities in Excel are quite handy, particularly if your worksheets will be used by others. When developing a worksheet, you might wonder if there is a way to make the choices in one cell contingent on what is selected in a different cell. For instance, you may set up the worksheet so that cell A1 uses data validation to select a product from a list of products. You would then like the validation rule in cell B1 to present different validation lists based on the product selected in A1.

The easiest way to accomplish this task is in this manner:

  1. Beginning at cell F1, set up a data table. This table will contain your product "matrix." In the first cell of each column, indicate a category name, such as Computers, Televisions, and Recorders.
  2. Under each heading in the product matrix, list the various products in the category.
  3. Select the headings from the data table, such as F1:H1.
  4. Choose Insert | Name | Define. Excel displays the Define Name dialog box. (See Figure 1.)
  5. Figure 1. The Define Name dialog box.

  6. In the Name box, enter a descriptive name, such as Choices.
  7. Click OK to add the name and close the dialog box.
  8. Select the actual products in column F. Don't select the heading (F1); just select the products under the heading.
  9. Again display the Define Name dialog box, as described in step 4.
  10. In the Name box, enter the same name you used as a heading in that column, such as Computers.
  11. Click OK to add the name and close the dialog box.
  12. Repeat steps 7 through 10 for the other product columns. In each case, make sure you define the name as the same name used in the column header.
  13. Select cell A1 and choose Validation from the Data menu. Excel displays the Data Validation dialog box. (See Figure 2.)
  14. Figure 2. The Data Validation dialog box.

  15. Using the Allow drop-down list, choose List.
  16. In the Source box, enter an equal sign followed by the name you defined in step 5 (such as =Choices).
  17. Click OK.
  18. Select cell B1 and again display the Data Validation dialog box as described in step 12.
  19. Using the Allow drop-down list, choose List.
  20. In the Source box, enter the following: =INDIRECT(A1).
  21. Click OK. Excel displays a dialog box asking if you really want to use the rule. (This is because the referenced cell, A1, currently resolves to an error condition.)
  22. Click Yes.

That's it. Now, whatever is chosen in cell A1 dictates which list is presented in cell B1.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (3195) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Contingent Validation Lists.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Getting Rid of Extra Quote Marks in Exported Text Files

If you don't like the way that Excel exports information you intend to use with other programs, then your best bet is to ...

Discover More

Controlling Page Numbers in Mail-Merged Documents

Getting page numbers just the way you want when merging documents can seem a bit tricky. Here's how to make sure they ...

Discover More

Generating a Unique ID Number

If you are keeping track of people or things within Excel, you may want to devise unique ID numbers you can use for those ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (menu)

Forcing Editing to Be Done in a Cell

Excel allows you to edit your cell contents in two places. What if you want to limit where editing occurs, so it can only ...

Discover More

Ctrl+V Pasting is Flakey

When you copy and paste a formula, you usually want to see the formula where you pasted. If you don't get the formula, ...

Discover More

Shortcut for Selecting a Data Range

Want to select all the data in a contiguous section of a worksheet? The shortcut discussed in this tip makes it very easy.

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 4 + 0?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.