Professional Documents
Culture Documents
ExcelDataValidationDependentLists
(http://www.contextures.com/index.html)
Sections
Video:DependentDataValidation
CreateNamedLists
ApplytheExcelDataValidation
TesttheExcelDataValidation
AddingaThirdDependentList
UsingTwoWordItems
UsingItemswithIllegalCharacters
UsingDynamicLists
Video:BlockChangesinFirstDropDown
BlockChangesinFirstDropDown
ClearDependentCellAfterSelecting
DownloadtheSampleFile
http://www.contextures.com/xlDataVal02.html
1/15
1/19/2016
ExcelDataValidationDependentLists
However,youcanusetheExcelIFfunctiontomaketheselectionmoreflexible.Ifnocountryisselected,theCity
columnwillshowalistofworldcitiesinthedependentdropdownlist.
2/15
1/19/2016
ExcelDataValidationDependentLists
e. PresstheEnterkey.
f. CreateanotherlistwiththeitemsforthenextProduceTypeVegetableinthisexample
c. FromtheAllowdropdownlist,chooseList
d. IntheSourcebox,typeanequalsignandthelistname,forexample:=Produce
e. ClickOK.
http://www.contextures.com/xlDataVal02.html
3/15
1/19/2016
ExcelDataValidationDependentLists
Note:IfcellA2isempty,you'llseethemessageshownbelow.ClickYestocontinue.
4/15
1/19/2016
ExcelDataValidationDependentLists
2. PresstheTabkeyonyourkeyboard,tomovetotheItemcolumn,inthesamerow.
3. IntheItemcolumn,clickthedropdownarrow,andselectanitem.ThedropdownlistshowseitherFruitor
Vegetableitems,dependingwhichhasbeenselectedintheProduceTypecolumn
NOTE:IfaProduceTypehasnotbeenselected,theItemdropdowninthatrowwill
notwork.
1. Createthetwonamedrangesanddropdownlistsasdescribedabove.
2. Createanothersetofnamedranges,namingthemfortheavailablecombinationsinthefirsttwoExceldata
validationdropdowns.Forexample,youmightcreaterangesnamedCanadaOntarioandUSANewYork.
3. Forthethirddropdown,choosetoAllow:List,anduseaformulathatcombinestheentriesinthefirsttwo
columns,andremovesthespacesfromthenames.Forexample,incellD2,thedatavalidationformula
wouldbe:
=INDIRECT(SUBSTITUTE(B2&C2,"",""))
5/15
1/19/2016
ExcelDataValidationDependentLists
3. Fortheseconddropdown,choosetoAllow:List,anduseaformulathatremovesthespacesfromthenames.
Forexample:
=INDIRECT(SUBSTITUTE(A2,"",""))
Forexample,yourchoicesare'RedFruit','GreenFruit'and'Yellow&OrangeFruit'.Forthedependentlists,you
cancreaterangeswithonewordnames,suchasYOFruit.Then,createalookuptable,whichlistseachitemin
thefirstExceldatavalidationdropdownlist,andtherangewhereitsdependentitemswillbestored.
Tostart,createtheitemlistsandthefirstExceldatavalidationdropdown:
1. Createthefirstnamedrangeanddropdownlistasdescribedabove.Inthisexample,therangeisnamed
ProductList,withvaluesincellsA6:A8.ThedropdownlistincellA2usesProductListasitssource.
2. Createthedependentlists,andnamethem,usingonewordnames,with"List"attheend,e.g.
RedFruitList,GreenFruitList,YOFruitList.Inthisexample,RedFruitListisinA11:A12,
YOFruitListisinA15:A16andGreenFruitListisinA19:20.
3. SelectanitemfromthedropdownlistincellA2.
Next,you'llcreatethelookuptable,tomatcheachitemwithitsdependentitems'rangename.
1. InthecolumntotherightoftheFruitListrange,enterthecodenameforeachitem'sdependentlist.For
example,YOFruitisenteredasthecodenameforYellow&OrangeFruit.
2. Namethelookuptable.Inthisexample,therangeA6:B8isnamedProductLookup.
3. SelectcellB2,andfromtheDatamenu,chooseValidation.
4. ChoosetoAllow:List.
5. FortheSource,enteraformulathatusesaVLookupformulatofindthedependentlist'srangenamea
combinationofthecodenameand"List".
Forexample:=INDIRECT(VLOOKUP(A2,ProductLookup,2,0)&"List")
WithRedFruitselectedincellA2,theVLookupformulawillreturnRedFruitListastherangenameforthe
dependentlist.TheRedFruitListitemswillbedisplayedincellB2'sdropdown.
http://www.contextures.com/xlDataVal02.html
6/15
1/19/2016
ExcelDataValidationDependentLists
Tocreatea3rddependentdropdownlist,usethesametechniques,tocreatelookuptablesanditemslists.
Inthescreenshotbelow,therearelookuptablesnamedRedFruitLookup,YOFruitLookupand
GreenFruitLookup.Itemslists,withthecodenamesand"List",havebeenaddedtotheworksheet.
Inthedatavalidationwindow,usethisformulaforthe3rddropdown:
=INDIRECT(VLOOKUP(B2,INDIRECT(VLOOKUP(A2,ProductLookup,2,0)&"Lookup"),2,0)&"List")
TheformulafindsthelookuptablebasedontheproducttypeselectedincellA2,e.g.RedFruitLook,andgetsthe
codefortheselectedproductMac.Itadds"List"tothecode,andshowstheitemsintheMacListrange.
7/15
1/19/2016
ExcelDataValidationDependentLists
BecausetheINDIRECTfunctiononlyworkswithreferences,notformulas,thepreviousmethodfordependent
datavalidationwon'tworkwithdynamiclists.Instead,youcanusethefollowingmethod:
1. Createthefirstnamedrangeanddropdownlistasdescribedabove.
2. Createthesupportingnamedlists,andnamethefirstcellineachrange,e.g.cellB1isnamedFruitandcell
C1isnamedVegetables.
3. Namethecolumninwhicheachlistislocated,e.g.columnBisnamedFruitColandcolumnCisnamed
VegetablesCol
4. Fortheseconddropdown,choosetoAllow:List,anduseaformulathatcalculatesthelookuprange.For
example,ifthefirstdropdownlistisincellE2:
=OFFSET(INDIRECT($E2),0,0,COUNTA(INDIRECT(E2&"Col")),1)
iftwoworditemswillbeused,youcanincludetheSUBSTITUTEfunctioninthe
formula:
=OFFSET(INDIRECT(SUBSTITUTE($F2,"
","")),0,0,COUNTA(INDIRECT(SUBSTITUTE($F2,"","")&"Col")),1)
8/15
1/19/2016
ExcelDataValidationDependentLists
Withdependentdropdownlists,problemscanoccur,ifsomeonegoesbacktothefirstlist,andchangesit.Then,
thefirstandsecondselectionsaremismatchedforexample,inthescreenshotbelow,Vegetableisthefirst
choice,andBananaisselectedinthesecondcolumn.
Toblockchangestothefirstlist,youcanchangethedatavalidationformula,sothelistdoesn'tworkunlessthe
secondcellisempty.
InsteadofjustreferringtotheProducerangefortheProduceTypedropdown,theformulawillcheckforanentry
intheItemcolumn.
IftheItemcellisblank,theProduceTypedropdownwillshowtheProducelist
Ifanitemhasbeenselected,thedropdownwilltrytoshowtherangecreatedbytheINDIRECTfunction
"FakeRange".Becausethereisnorangewiththatname,theresultisanerror,andthedropdownwillnot
work.
Tochangetheformula:
1.
2.
3.
4.
Selectthedatavalidationcellsinthefirstcolumn
OntheRibbon'sDatatab,clickDataValidation
ForAllow,selectList
IntheFormulabox,type:
=IF(C2="",Produce,INDIRECT("FakeRange"))
5. ClickOK
Now,thedropdowninthefirstcolumnwon'tworkiftheItemhasbeenselectedinthatrow.
http://www.contextures.com/xlDataVal02.html
9/15
1/19/2016
ExcelDataValidationDependentLists
Gobackandselectadifferentregion,andtheexistingcustomernamewillbecleared.
http://www.contextures.com/xlDataVal02.html
10/15
1/19/2016
ExcelDataValidationDependentLists
GetExcel
News
Name:
Email:
Werespectyouremailprivacy
(https://www.aweber.com/permission.htm)
More Tutorials
DataValidationBasics(xlDataVal01.html)
DependentDropdownsfromaSortedList(xlDataVal13.html)
DependentListsWithINDEX(xlDataVal15.html)
HidePreviouslyUsedItemsinaDropdownList(xlDataVal03.html)
UseaDataValidationListfromAnotherWorkbook(xlDataVal05.html)
DataValidationCriteriaExamples(xlDataVal06.html)
DataValidationTips(xlDataVal08.html)
DataValidationWithComboBox(xlDataVal10.html)
Search
SearchContexturesSites
Search
__
Search
CustomSearch
http://www.contextures.com/xlDataVal02.html
11/15
1/19/2016
ExcelDataValidationDependentLists
More Tutorials
DataValidationBasics(xlDataVal01.html)
DependentDropdownsfromaSortedList(xlDataVal13.html)
DependentListsWithINDEX(xlDataVal15.html)
HidePreviouslyUsedItemsinaDropdownList(xlDataVal03.html)
UseaDataValidationListfromAnotherWorkbook(xlDataVal05.html)
DataValidationCriteriaExamples(xlDataVal06.html)
DataValidationTips(xlDataVal08.html)
DataValidationWithComboBox(xlDataVal10.html)
(http://www.contextures.com/datavalidationmultiselectpremium.html)
Contextures
Excelnews
byemail
Email:
Name(optional):
Signup
http://www.contextures.com/xlDataVal02.html
12/15
1/19/2016
ExcelDataValidationDependentLists
Werespectyouremail
privacy
(http://www.aweber.com/permission.htm)
(http://www.contextures.com/exceltoolsaddin.html)
http://www.contextures.com/xlDataVal02.html
13/15
1/19/2016
ExcelDataValidationDependentLists
(http://www.contextures.com/datavalidationmultiselectpremium.html)
(http://www.mothresource.com/104516.html)
(http://www.contextures.com/datavalidationmultiselectpremium.html)
http://www.contextures.com/xlDataVal02.html
14/15
1/19/2016
ExcelDataValidationDependentLists
(http://www.exceluser.com/cmd.php?Clk=2511398)
GetExcel
News
Name:
Email:
CopyrightContexturesInc.2016
PrivacyPolicy(/privacy.html)
(https://mvp.microsoft.com/enus/mvp/Debra%20%20Dalgleish7612)DebraDalgleish
(https://mvp.microsoft.com/enus/mvp/Debra%20%20Dalgleish7612)
Lastupdated:December30,20152:21PM
http://www.contextures.com/xlDataVal02.html
15/15