Excel Dependent Drop Down List with Repetitive Values - excel

I have some data stored in an hierarchical way like this:
And I want to create three drop down lists from where you can select the Product in the Category based on the Store,Something like this:
The tricky thing here is the fact that a product(i.e Frozen Pizza) can be found on both stores while others (Lays) can only be found on one store.
How can I achieve this or how can I store the data in such a way that I can have the same result?.
I've tried things like named range with the data stored in a table like structure and with =INDIRECT (but won't work because of illegal characters like spaces,symbols,etc in the named range).I am looking for a Formula not a VBA.

I think you were on the right track. If not using VBA, I would use data stored in a table with named ranges and the INDIRECT formula.
That approach would be arduous as you would have to build out each list in its own range (e.g. products in category 1 of store 1, products in category 2 of store 1, etc.).
Also, as you mentioned, the named ranges are strict, so you would need to convert spaces and symbols to _ or omit them completely. You could consider using numeric IDs in the drop down lists instead of text, but the user would need to know what the IDs represent. You could then translate the IDs back to text using a lookup table once selected.
VBA would certainly provide a better solution.

Related

Taking means of irregular amounts data

I'm not able to take the means for a large dataset given that the amount of attributes is irregular.
I have posted a simplified case for the problem. It explains the problem very well.
An idea that I came up with: Make a filter to condition on a single attribute. However, still, I don't see a way to do this in an efficient way (other then doing it all by hand).
see excel file:
All help is much appreciated.
I'm basically looking for a function/method to achieve taking means of all different attributes conditioned on each person for a large dataset without doing it by hand.
You can use AVERAGEIFS() inside an IF:
=IF(OR(A2<>A1,B2<>B1),AVERAGEIFS(C:C,A:A,A2,B:B,B2),"")
the ifrst part of the if tests whether the row starts a new group either by the person or the attribute changing. Then it uses AVERAGEIFS() to return the correct average of that group. otherwise it returns a blank
What you want to do can be accomplished very simply with a pivot table.
Simply select one of the cells inside the range of data you want to process(See the video for general use of a pivot table https://www.youtube.com/watch?v=iCiayB6GrpQ )
go the insert tab and insert pivot table.
Once you have it, simply check people, attribute, and values. Then drag people and attribute into rows, drag valut into the values window, select the drop down list and change it from sum of value to average and you should be done. https://i.stack.imgur.com/nYEzw.png

Excel - how to create a dependent drop down list that uses different levels?

I'm trying to determine how to create a dynamic drop-down list that will take into consideration two different attributes.
In my example below, I have three cost elements: Labor, Infrastructure, and Licenses. Each of these have different levels. For example, Labor at L1 has: Storage Management, Database Managed, and Compute Management. At L2 it has: Manager, Vice President, and Managing Director.
I want in cells E18:F20 for each cell to have a drop down list, for that cost element and for that level.
I've tried using the "Indirect" formula but you need to have the specific named range. I need something that can look up a range based on two attributes, the cost element and level.
Anyone know what I should type in the Data Validation field?
Named ranges cannot have spaces, so your range names will have to use an underscore or omit that character altogether for the dependent ranges. For example "LaborL2".
Define all these named ranges, LaborL1, LaborL2, InfrastructureL1, etc.
Then you can use the Indirect function to concatenate $F18 and G$17. like
=INDIRECT($F18&G$17)
Then you can see the correct list in the dropdown.

Single Use List - Excel

I'm after a way of preferably using VLookup to return information and once returned, have the source information unavailable for the same lookup.
e.g. If I have a list of names I have not used in seating for an event, I will want a formula which can look up this information WITHOUT entering the same name more than once. I'd rather not do a drop-down option as requires selecting the entry and I want my whole table to be an self-filling database.
I've about 20 nested IF functions going on in one cell so ideally something that could fit in there easily? Ill take anything honestly :P
Thanks in advance

Data validation without named ranges

I have the following example list:
Note: In my real list I have around 200 options and 400 suboptions
And I would like to have 2 dropdownlists to select any option and it's suboptions:
For options, I used data validation - list with range =$A$8:$A$12
And for suboptions I tried the following:
Named ranges
It works but it needs a lot of manual work to maintain as the suboptions list is updated kind of frequently and AFAIK I would need to create and maintain many named ranges as many options I have.
Example
Named Range: _ABC05
Refers To: =Sheet1!$D$9:$D$10
Data validation: = INDIRECT(CONCATENATE("_";SUBSTITUTE(A2;"-";"")))
Again, this works but I am trying to avoid to maintain 200 named ranges.
Any solution without using named ranges or vba?
Finally I solve it using dynamic data validation:
In hidden column D, I have the following formula:
=CONCATENATE("D";MATCH(A2;$C$8:$C$15;0)+7;":D";MATCH(A2;$C$8:$C$15;1)+7)
And the data validation like this:
=INDIRECT(D2)
Edit: As mentioned by Aprillion, this will only work if the options list is sorted alphabetically ascending. In my case it is always like that but it would be interesting to know another solution with unsorted data. Also, In this example it is possible to avoid the hidden column and use =indirect(concatenate... in the data validation but in my case I have the lists in a separate worksheet and it is not possible to reference a data validation list in external workbooks or worksheets.
One issue is that once the user select an option and corresponding suboption, and then change again the option, the suboption is still selected even if it is not mapped to the new option. I found one solutions that consists in using a fake list as source of the data validation when C2 already have a value:
=IF(C2="";INDIRECT("$A$8:$A$12");INDIRECT("FakeList"))

Excel Lookup with multiple queries

I have a question that I a may not be thinking correctly about. But I have an a long excel file that I pull from somewhere else with the following columns:
Project_Name1, Employee_Name1, Date_Worked1, Hours_Worked1
In another sheet I have these columns
Project_Name2, Employee_Name2, Begin_Date2, End_Date2, Hours_Worked2
This second sheet is filled with data, and works just fine.
However, it turns out that I have some employee names that I do not know that are also working on the same project. I need to figure out the names of the employees and then sum the number of hours they worked for a given period.
So I need a lookup with three criteria:
Project_Name1 = Project_Name2
Employee_Name1 <> {Array of Employee_Name2}
Begin_Date2 <= Date_Worked1 > End_Date2
Returning Employee name.
Once I have the employee name, I can do a sumifs=() and get the total hours they worked no problem.
I have tried a number of combinations of Index Match functions, using ctrl-shift-enter... and have not been able to figure out it. Any help would be greatly appreciated.
What you're talking about doing is extremely complicated and a little bit past what Excel was designed to do by default. However, there are a few workarounds that you can use to attempt to get the information that you're looking for.
It's possible to do multiple-criteria VLOOKUPs and SUMIFs by concatenating fields to make a multi-part identifier (Ex: Insert a new column and have a forumla in it like =A1&B1)
Open a new workbook and use Microsoft Query (I'm not sure if you can select from more than one sheet, but if you can select from multiple sheets like tables you should be able to write a semi-complex query to pull the dataset you want.
http://office.microsoft.com/en-us/excel-help/use-microsoft-query-to-retrieve-external-data-HA010099664.aspx
Use the embedded macro feature and use visual basic script to write out your business logic. (Hotkey is ALT+F11)
One way to do this would be to first create an additional column to the right of entries on the sheet you're trying to pull employee_name from: =ROW()
You could then use an array formula like you were trying to implement to pull the corresponding 'match' row:
{=SUM((project_name1=projectname2)*(employeename1<>employeename2)*(begindate<=date_worked1)*(date_worked1>end_date2)*(match_column))}
You could then use this returned match_column entry within the index as you described to retrieve the appropriate entries.

Resources