Data validation for drop down

layalhasan

New Member
Joined
Jun 22, 2017
Messages
4
I have a excel sheet and i have created a data validation function. Its a conditional dropdown but I can not input my equation in data validation field. Its says too many arguments. My equation is
Code:
[FONT=Arial]=IF(A4="Capital",'New List'!$C$2:$C$42,IF(A4="Pier Caps",'New List'!$C$43:$C$84),IF(A4="Keystones",'New List'!$C$85:$C$86),IF(A4="Round Louvre",'New List'!$C$87:$C$88),IF(A4="Open Rings",'New List'!$C$89:$C$90),IF(A4="Pyramids",'New List'!$C$91:$C$92),IF(A4="Plinths",'New List'!$C$93:$C$94),IF(A4="Columns",'New List'!$C$95:$C$96))[/FONT]


What i am missing here? Is it too long? Is there any other way to achieve this? I have some more argument which i need to add with this function. Please help
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
I have a excel sheet and i have created a data validation function. Its a conditional dropdown but I can not input my equation in data validation field. Its says too many arguments. My equation is
Code:
[FONT=Arial]=IF(A4="Capital",'New List'!$C$2:$C$42,IF(A4="Pier Caps",'New List'!$C$43:$C$84),IF(A4="Keystones",'New List'!$C$85:$C$86),IF(A4="Round Louvre",'New List'!$C$87:$C$88),IF(A4="Open Rings",'New List'!$C$89:$C$90),IF(A4="Pyramids",'New List'!$C$91:$C$92),IF(A4="Plinths",'New List'!$C$93:$C$94),IF(A4="Columns",'New List'!$C$95:$C$96))[/FONT]


What i am missing here? Is it too long? Is there any other way to achieve this? I have some more argument which i need to add with this function. Please help
First, if you want to use a custom function it must evaluate to TRUE or FALSE and it will not produce a dropdown.

To produce a dropdown using the value in A4 you can do this.
1. Create named ranges like: Capital, Pier_Caps, Keystones, ...... with your list for each name.
2. Select the cell you want the dropdown in.
3. In the Data validation dialog box select 'List' and in the formula box type: = INDIRECT(A4)
Now if you enter 'Capital' in A4 the Data Validation drop down will show the list for the named range 'Capital'.
 
Upvote 0
JoeMo is correct for the best way to get a conditional list for data validation but you need to keep in mind that if the input value in A4 doesn't match a Name then probably no entry will be accepted in the validated cell and you won't get the dropdown.

Also you haven't embedded the if statements correctly to evaluate the formula you originally posted. The next if condition needs to be in the third term of the if statement above it e.g.

Code:
=IF(A1="City", "True1", IF(A1="Country", "True2", "ultimate fail"))
 
Last edited:
Upvote 0
First, if you want to use a custom function it must evaluate to TRUE or FALSE and it will not produce a dropdown.

To produce a dropdown using the value in A4 you can do this.
1. Create named ranges like: Capital, Pier_Caps, Keystones, ...... with your list for each name.
2. Select the cell you want the dropdown in.
3. In the Data validation dialog box select 'List' and in the formula box type: = INDIRECT(A4)
Now if you enter 'Capital' in A4 the Data Validation drop down will show the list for the named range 'Capital'.

Thanks for your quick reply. I followed your idea and created table and assigned name. Then I used =INDIRECT() function. It works.

But one little problem. Name with two words won't work.
 
Upvote 0
JoeMo is correct for the best way to get a conditional list for data validation but you need to keep in mind that if the input value in A4 doesn't match a Name then probably no entry will be accepted in the validated cell and you won't get the dropdown.

Also you haven't embedded the if statements correctly to evaluate the formula you originally posted. The next if condition needs to be in the third term of the if statement above it e.g.

Code:
=IF(A1="City", "True1", IF(A1="Country", "True2", "ultimate fail"))

Thanks for reply. You are right by the way. For "Piers Cap", data validation won't work because I had to name that range to "Piers_Caps". Any other way to fix this issue?
 
Upvote 0
Thanks for reply. You are right by the way. For "Piers Cap", data validation won't work because I had to name that range to "Piers_Caps". Any other way to fix this issue?

Unfortunately not; spaces are not allowed in a named range. Have a look at This Link for the rules.
 
Upvote 0

Forum statistics

Threads
1,223,883
Messages
6,175,167
Members
452,615
Latest member
bogeys2birdies

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