Excel - Conditional Dropdown List
Solved
cyrilounet
-
Vitcthor -
Vitcthor -
Good evening,
I would like to create a dropdown list in Excel where the displayed content depends on the value of the previous cell (which itself is a dropdown list).
To be clearer, I have a list of services List_Services (Service 1, Service 2, Service n...) in one cell. I created this list from the "Data / Validation" menu. I would like the next cell to display a list of items corresponding to the selected service.
In short, I have in an Excel sheet (Sheet A) the following table:
In another sheet (Sheet B), I have (simplified) the following cells:
Once the service is selected in this sheet, I want the List_Item to display based on the choice made (that is, based on List_Services). If I select Service 2, I want only the list for Service 2 (column C of Sheet A) to show up.
I’m not quite sure how to do this. The lists are defined.
I hope I have clearly explained the problem I have so that someone can help me out.
A big thank you in advance to whoever will help me solve this issue.
Best regards.
I would like to create a dropdown list in Excel where the displayed content depends on the value of the previous cell (which itself is a dropdown list).
To be clearer, I have a list of services List_Services (Service 1, Service 2, Service n...) in one cell. I created this list from the "Data / Validation" menu. I would like the next cell to display a list of items corresponding to the selected service.
In short, I have in an Excel sheet (Sheet A) the following table:
| A | B | C | D | E 1 | | Service 1 | Service 2 | Service 3 | Service n 2 | Service 1 | Item B2 | Item C1 | Item D1 | Item E1 3 | Service 2 | Item B3 | Item C2 | Item D2 | Item E2 4 | Service 3 | Item B4 | Item C3 | Item D3 | Item E3 5 | Service n | Item Bn | Item Cn | Item Dn | Item En
In another sheet (Sheet B), I have (simplified) the following cells:
List_Services | List_Item
Once the service is selected in this sheet, I want the List_Item to display based on the choice made (that is, based on List_Services). If I select Service 2, I want only the list for Service 2 (column C of Sheet A) to show up.
I’m not quite sure how to do this. The lists are defined.
I hope I have clearly explained the problem I have so that someone can help me out.
A big thank you in advance to whoever will help me solve this issue.
Best regards.
Configuration: Windows XP Firefox 2.0.0.11
39 réponses
- 1
- 2
Suivant
Hello,
Actually, I created my lists in one sheet (Sheet_List), as follows:
I then named each list:
- listServices for B1:E1
- ERR_list1 for B2:B3
- ERR_list2 for C2:C5
- ERR_list3 for D2:D4
- ERR_listn for E2:E5
In my main sheet (Sheet1), in the cell where I wanted to display my first list (E2 for example), I created a list as follows:
- Data menu / Validation;
- in the "allow" section, I selected "List";
- in the "Source" section, I entered the following formula: =listServices then OK.
In the next cell F2 (cell whose display depends on the choice of the previous cell), I proceeded as follows:
- Data menu / Validation;
- in the "allow" section, I set it to "List";
- in the "Source" section, I entered the following formula: =INDIRECT("ERR_"&(SEARCH(E2,listServices)))
And that's it (if I haven't forgotten anything). If you need more explanation or help, feel free to ask ;-)
Best regards
Actually, I created my lists in one sheet (Sheet_List), as follows:
| A | B | C | D | E
1 | | Service 1 | Service 2 | Service 3 | Service n
2 | Service 1 | Symptom 1_1 | Symptom 2_1 | Symptom 3_1 | Symptom n_1
3 | Service 2 | Symptom 1_2 | Symptom 2_2 | Symptom 3_2 | Symptom n_2
4 | Service 3 | | Symptom 2_3 | Symptom 3_3 | Symptom n_3
5 | Service n | | Symptom 2_n | | Symptom n_n
I then named each list:
- listServices for B1:E1
- ERR_list1 for B2:B3
- ERR_list2 for C2:C5
- ERR_list3 for D2:D4
- ERR_listn for E2:E5
In my main sheet (Sheet1), in the cell where I wanted to display my first list (E2 for example), I created a list as follows:
- Data menu / Validation;
- in the "allow" section, I selected "List";
- in the "Source" section, I entered the following formula: =listServices then OK.
In the next cell F2 (cell whose display depends on the choice of the previous cell), I proceeded as follows:
- Data menu / Validation;
- in the "allow" section, I set it to "List";
- in the "Source" section, I entered the following formula: =INDIRECT("ERR_"&(SEARCH(E2,listServices)))
And that's it (if I haven't forgotten anything). If you need more explanation or help, feel free to ask ;-)
Best regards
- 1
- 2
Suivant
I have looked into Cyrilounet's formulas.
I have applied them because a dropdown list that depends on another would lighten the workload on Excel files.
If I started the 1st list with the following formula: =listeServices then OK., that one works.
The 2nd list returns no results, and I can see that it's normal because it does not use the names of the columns of the data table, namely:
- ERR_liste1 for B2:B3
- ERR_liste2 for C2:C5
- ERR_liste3 for D2:D4
- ERR_listen for E2:E5
In short, the formula =INDIRECT("ERR_"&(RECHERCHE(F2;listeServices))) seems incomplete.
So do you see any possibility?
As for me, these formulas are teaching me the depths of Excel and will allow me to adapt them to other data...
Thank you in advance for revisiting your formulas.
Best regards
* The formula is =INDIRECT("ERR_"&(SEARCH(F1,listservices))) --> F1 instead of F2
* Do not put spaces in the fields and name the lists (ERR_service1, ERR_service2,...)