jdc2k2

New Member
Joined
Apr 30, 2006
Messages
6
I have created a dynamic data validation list in a worksheet, using nested IF statements and named ranges. The list shows up just fine, however, I am not getting an error when I enter invalid data. I've checked to make sure the error alert is enabled and recreated the data validation a few times using the INDIRECT statement (some references I found seemed to suggest this might be necessary).

To clarify, I want to have the dynamic validation list displayed based on the value of another cell, and I also need it to restrict the data input to that validation list. I'm using Excel 2007. The worksheet is not shared or protected at this time.

Here's a summarized version of the current validation list formula.

=IF($A1="1",List1,IF($A1="2",List2,IF($A1="3",List3,IF($A1="4",List4,IF($A1="5",List5,DefaultList)))))

I've done the normal digging around with forum/Google searches and help file reading, but so far I haven't found an answer to this issue. Hopefully I didn't overlook something simple and am not wasting people's time.

Thanks for your time and any assistance you can provide!
 
Last edited:

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Perhaps you tried this already, but this really should work:

1. enter your validation formula into, say, cell B1:

=IF($A1="1","List1",IF($A1="2","List2",IF($A1="3","List3",IF($A1="4","List4",IF($A1="5","List5","DefaultList")))))

By the way, do you need to use double-quotes for numbers ?

2. select cell where your dropdowns are to appear and choose Data -> Data Validation

3. Allow List
4. Source "=INDIRECT($B$1)" (without quotes)
5. Tick "Show error alert after invalid data is entered"

When A1 is empty, dropdown should be empty and no values accepted.
Otherwise, dropdown should be populated and only values from dropdown accepted.
 
Last edited:
Upvote 0
That worked!

I guess when I used the indirect statement before, I was still using it in the formula box inside the validation list options, not an actual formula in a worksheet cell.

Is there anyway to do this as just a formula inside the data validation options, instead of having to add the column for the formula in the worksheet?

On the double quotes around the numbers, they are actually proper named strings in my formula, I just summarized the list 1-5 for the sake of simplicity.
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top