Forum Discussion
Dependent Dropdown List With Pivot Table
- Jan 02, 2022
Hi @kheldar
As Riny_van_Eekelen mentioned, using Excel 365 it is possible with FILTER and UNIQUE without using a pivot table.
The attached example is functional from Shift to Name where eg the formula in i9 results in the drop down list that is used in i2.
=UNIQUE(FILTER(Table1[Name];(--(Table1[Shift]=--$G2))*--(Table1[Group]=$H2)))
G9 concatenates hour with minutes to make it look like time. TEXT() is not generic functional since h:mm is translated into eg t:mm in swedish Windows.
HOUR(data) & ":" & TEXT(MINUTE(data);"00")
--G2 makes Excel treat the string as a number again.
-/-
G8:i9 may be cut and pasted on another sheet.
Duplicates will give you problem since it is not possible to differ if you first or second instance of same text is chosen. And even if it was solved in the model, maybe it could be confusing for a user not knowing the difference between first and second duplicate..?
Thank you for the reply. got an error #value!
Unfortunately I cannot upload. This is the formula from your file:
=LET(data,UNIQUE(FILTER(Table1[Shift],Table1[Shift]<>0)),
HOUR(data) & ":" & TEXT(MINUTE(data),"00")
)
This is the table
Shift | Group | Name |
Text | Video 1 | Employee 1 |
8:00 | Video 1 | Employee 2 |
8:00 | Video 2 | Employee 3 |
Data validation: but i can choose "8:00" and give me the correct data validation but i cannot choose the "text" on the Shift column
Shift | Group | Name |
#VALUE! | #VALUE! | #VALUE! |
- bosinanderFeb 04, 2023Iron ContributorYou're welcome 🙂
- svgvervitFeb 03, 2023Copper Contributor
bosinander It worked! Thank you so much!
- bosinanderFeb 02, 2023Iron Contributor
Hi svgvervit It is possible eg as attached.
- Since g9:i9 spills downwards, they would interfere with the next rows possible choices.
Therefore, the unique choices are transposed to be presented horizontally. - The row can without more complexity only hold one set of allowed choices.
Column L thus holds the choices for the next empty cell. - Already made choices cannot have any other choices than what is already chosen.
This also makes sense logically - it should probably not be allowed to change a hierachically higher choice when there are still made lower ones). - As soon as one choice is made, this setup prepares for the next empty cells choices.
To change the last choice, the cell first has to be cleared.
The formula in column L handles the different entered possibilities to present the corresponding choices and row 6 is like an if-statements 'else'.
Choice1 is a defined name for the whole column G, Choice2=$H:$H and Choice3=$i:$i=TRANSPOSE(IFS( @Choice1&@Choice2&@Choice3=""; UNIQUE(Table1[Cat 1]); @Choice2&@Choice3=""; UNIQUE(FILTER(Table1[Cat 2];Table1[Cat 1]=@Choice1)); @Choice1&@Choice3=""; UNIQUE(FILTER(Table1[Cat 3];(Table1[Cat 2]=@Choice2))); @Choice3=""; UNIQUE(FILTER(Table1[Cat 3];(Table1[Cat 1]=@Choice1)*(Table1[Cat 2]=@Choice2))); 1; "#N/A" ))
The data validation in cell i24 first tests if the cell itself is not empty and in that case only have its own value as allowed choice.
If it is not empty, it will allow the values in column L including its spilled results (the hashmark in L24# addresses also the spilled cells).
=IF(I24<>"";I24;$L24#)
NB - my local settings use semicolon as list separator - not comma.
- Since g9:i9 spills downwards, they would interfere with the next rows possible choices.
- svgvervitDec 07, 2022Copper Contributorbosinander I am working on a similar scenario. I was wondering if it is also possible to pull the lists in the cells G2:I2 to the cells downwards (3-4-..), and that the formula's in de cells G9:I9 automatically adjust along with them to the new row? So every row gets a unique list, dependant on what is chosen in the first column (cat1)? If I pull the lists downwards right now, the formula keeps comparing with the cells in the second row.
Thanks in advance! - bosinanderNov 11, 2022Iron ContributorYou're welcome 🙂
- m_dashedNov 11, 2022Copper ContributorThank you so much!
- bosinanderNov 10, 2022Iron Contributor
m_dashed You are of corse correct. The former attached example expected and parsed times in a way that gave you the error.
The now atteched file is more generic and will do it with text.
Duplicates are welcome in all of the three categories.G6:i9 can be moved to another sheet since it is only help calculations. Cut and paste if you want.