Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and 2021. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Contingent Validation Lists.

Contingent Validation Lists

Written by Allen Wyatt (last updated March 6, 2021)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and 2021


3

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. Display the Formulas tab of the ribbon.
  5. Click the Define Name tool in the Defined Names group. Excel displays the New Name dialog box. (See Figure 1.)
  6. Figure 1. The New Name dialog box.

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

  18. Using the Allow drop-down list, choose List.
  19. In the Source box, enter an equal sign followed by the name you defined in step 6 (such as =Choices).
  20. Click OK.
  21. Select cell B1 and again display the Data Validation dialog box as described in step 15.
  22. Using the Allow drop-down list, choose List.
  23. In the Source box, enter the following: =INDIRECT(A1).
  24. 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.)
  25. 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 (11943) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and 2021. You can find a version of this tip for the older menu interface of Excel 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

Adjusting Test Scores Proportionately

Teachers often grade on what is affectionately referred to as "the curve." The problem is, it can be a bit difficult to ...

Discover More

Maintaining Fields in a Merged Document

When merging documents, you may want to include some fields in the merged documents. For some fields this is impossible, ...

Discover More

Swapping Two Strings

Part of developing macros is learning how to use and manipulate variables. This tip examines a technique you can use to ...

Discover More

Dive Deep into Macros! Make Excel do things you thought were impossible, discover techniques you won't find anywhere else, and create powerful automated reports. Bill Jelen and Tracy Syrstad help you instantly visualize information to make it actionable. You’ll find step-by-step instructions, real-world case studies, and 50 workbooks packed with examples and solutions. Check out Microsoft Excel 2019 VBA and Macros today!

More ExcelTips (ribbon)

Answering Questions in Order

It is not unusual to use Excel to gather the answers to users' questions. If you want your users to answer your questions ...

Discover More

Limiting Entry of Names

When inputting information into a worksheet, you may need a way to limit what can be entered. This scenario is a prime ...

Discover More

Prohibiting Single-Digit Entries in a Cell

The Data Validation capabilities of Excel can be very helpful when you are trying to control what people can enter into a ...

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 3 + 9?

2022-02-05 08:56:45

Victor

Hi Allen,

I would like to ask if it's possible to do a "circular" form of data validation?

e.g.
column A uses a validation list (i.e. column F contains A,B,C,D,E),
column B uses e.g. Vlookup (i.e. vlookup column F and column G that contains Apple,Bananas,Cherries,Dates,Eggplant) to check if A2="A", then B2=Apple.

What I like to do is to be able to enter Apple in B2 and it fills A2 with "A", so that I can change values in column A or B and it will reflect accordingly.

Thanks in advance!


2021-03-20 14:32:51

Einat Zvirin

This is very good for a 2 dimensional problem. Any suggestions for a more complex 3D or 4D problem?
Thanks


2021-03-06 05:45:08

Mike

Step 12 could become very tedious if you have many columns. Selecting the entire table and choosing Formulas Tab - Defined Names - Create from Selection will deal will all the columns in one go. Just ensure you have Top Row only selected.


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu 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.