My problem is the following:
I have multiple columns i want to make dependent lists of, but i have duplicates in the first 3 columns. I am able to make them dependent, but all the duplicates show up in the dropdown.
For Example:
You can see, the First column has duplicates and so does the second.
This is what i have tried.
Made the Product Category list as a List under Data validation using the uniques only.
Used the Offset, match formula to make the Sub-Product ID as a dependent list on what is selected in the cell before it for Product category.
When i do No. 2, say i chose A1 in the Product category, i end up getting 100,100 in the drop-down. I only want one iteration of 100 to be in the dependent dropdown.
Formula Used: =OFFSET(Second!E5,MATCH(C3,Second!$D$6:$D$282,0),0,COUNTIF(Second!$D$6:$D$282,C3))
Please help.
Related
I have over 1,100 lists that each contain no more than 30 items in them. I am trying to see if there are any items within the lists that appear in all lists. I was initially thinking that I would need to compare the list in column A to the list in column B, store the duplicates, then compare the duplicates to the list in Column C, store the new duplicates, compare the new duplicates to the list in Column D, and so on until all the lists have been covered.
My questions are:
1.) Is this the correct way to approach this?
2.) If so, is there a simple VBA code that could be used to do this?
Deduplicate each list using Data > Remove Duplicates
Collate all the lists into one long list
Create a pivot table with the column of items as the Row dimension
Use the same column as the Value displayed in the pivot table, and aggregate using Count.
Sort the pivot table in descending order of that count.
The count shows the number of lists in which each item appears. If any have a count of 1100 then they must occur in every list.
Here's my non VBA solution to this fun problem. The plan is to search each item in any one list and compare to all the other lists in the table.
Start off by inserting a new "A" column to the left of your table. Copy any list and paste to A35.
if your goal is only to find items occuring in all lists, choose the smallest list.
if you would like to analyse, choose the largest list or even multiple lists.
you could include all items by copy/paste TRANSPOSE the entire table to new sheet. then you have less than 30 colums. copy paste each into one column and delete duplicates of this list with data--> remove duplicates.
Now you need to create a formula in cell B35 that searches for the string in A35 in the range B1:B30. You drag the formula all the way right and down.
=COUNTIF(B$1:B$30,$A30)
The results will be the count of each item found in each list. In order to see if any item is in all lists, then all columns within the specific row should count at least 1 item. To the right of the results, see what the minimum value in the row is with:
=MIN(B35:API35)
(assuming your table ends in column API)
If any of your rows have a minimum of 1, then the item is included in all lists.
You could then also sum up the line to see which items occur the most and you could use the "max" instead of "min" to see if any list has duplicates.
Please try to use this
If it will not work I can help you with Macro VB code.
Logic will be as below:
1. Keep 1st column as base to check all the other column
2. Check each 30 cell of the 1st column in a loop with all the other column cell.
3. Stop the loop, if you don't the value in an entire column.
I have a list of actions in Excel, sorted by a couple of criterias by column, the 'key' or ID being the date it was added to the list. The relevant criterias are date in the A column, location, and category.
I want to follow-up on the actions listed by the criterias monthly. I have not gotten this function to work however, even after trying a couple of different functions. So basically I want to count the number of rows in column A (starting from row X, since the first columns are not included), that include the specific criteria from columns B and C. So I want to count the different categories separately, and each category by location.
The list of possibilities in B and C comes from a list that is used in data validation, so that the categories and locations are given in drop-down menus.
The follow-up is also on its own tab in the spreadsheet, and the list criterias on its own.
What I have tried so far is e.g. sumproduct with (--), countifs with the column and the expression (MONTH(A:A)=1) and (B:B;"criteriaX").
All of these give me a #VALUE!-error.
My question is , in excel when we create a dependent dropdown we write the formula for the other dropdown dependent on the first one. For example if USA is selected in first col the matching City of USA will be pulled and then can be populated in a data validation list.
I know how to write formula to get the items matching criteria. My problem is what if we have multiple dropdowns .
For example we have 100 rows with column A for selecting Countries and then next to each of these we have dropdown for selecting City.
Do I need to write 100 formulas for these dependent dropdowns or there is another way around to achieve this?
Consider the following,
The data validation lists in A2:A10 are based on a List with a Source: of,
=$AA$2:$AA$5
The data validation lists in B2:B10 are based on a List with a Source: of,
=INDEX($AB$2:$AE$6, 0, MATCH($A2, $AB$1:$AE$1, 0))
sample workbook
I'm trying to write a macro that i can run which will allow me to simply sort a range of orders into what i like to call categories.
The basic idea is that we get orders through, and we generally have to print a different type of shipping label for the different items, based on weight, size and value. Unfortunately, there is no easy way of doing this other than going through all orders (sometimes thousands) and copying them into different worksheets to group them into the type of shipping method we need to use.
What i'd like to do (i already have a couple of macros already) - is to look in another sheet whereby we store the item titles, and have a second column within that sheet with a number (1, 2 or 3). For each item, based on it's weight, size or value, which we have already specified - they would be assigned a number. The Macro will look at the item name, if the sales sheet finds a match from column A in the item's sheet, it will then add the correct number specified in the item's sheet to the cell next to the item title in the sales sheet.
Column A-G has all customer details, Column H has the item title. The number i'm wanting to add to the row will be inserted into Column I.
The item's sheet has Column A which is the item title, and Column B is the number assigned to this item.
I have tried to muster a macro up myself, however it's confusing me no end.
This is exactly what vlookup is used for
=VLOOKUP(H1, items!A:B,2,FALSE)
Put this formula into I1 on the sales sheet and drag it down, if the items sheet is not in the same workbook , you will need to modify the reference to point to it,
you could obviously write a macro that will insert this formula and drop it down, but it will still be using vlookup or application.vlookup to get the result
Wildcard searches at the front would be
=VLOOKUP("*"&H1, items!A:B,2,FALSE)
or both ends would be
=VLOOKUP("*"&H1&"*", items!A:B,2,FALSE)
NB* BE CAREFUL WITH THIS AS YOU MAY HAVE ITEMS WITH SIMILAR DESCRIPTIONS
like "apple" and "red apple"
you should always use a product code to do lookups when available
I'm trying to build an interface that allows a user to select a category of modification (17 total categories) and have the second drop down box list only those modifications (anywhere from 5-30 modifications) that apply to that category.
Normally, I would set up reference tables to indicate which modifications apply to which category. However, this particular tool is going to have new data populated every week by a non-technical person. There is already a structure in place that will assign each modification number to a given category. However, the list of modification numbers present in any given data pull will change so much that maintaining the separate lists will get overly cumbersome.
My hope is that there is a way to have a dynamic named range contain only those values where the category column is equal to the selected category.
I want to use DNRs because I will be using it as part of a validated data list that will end up controlling the display of a handful of graphs for the end user. Additionally, we aren't allowed to use macros for our shared spreadsheets.
A1 would contain the category (I can get this named range to work just fine, it's a basic one)
A2 should contain only those mods from column C where the corresponding cell in column D equals the value of A1.
You can use a dynamic range name to pull the sub categories if
there is a two-column table with categories in one column and sub categories in the other column
all main categories are repeated (no blanks)
the table is sorted ascending by the main category column.
A dynamic range name can then be built with a formula along the lines of
=INDEX(Sheet1!$B:$B,MATCH(Sheet1!$E$2,Sheet1!$A:$A,0)):INDEX(Sheet1!$B:$B,MATCH(Sheet1!$E$2,Sheet1!$A:$A,1))
So, you only need to work out how to get this two-column table created dynamically from your data entry tool.
I did something similar recently, where the subcategories had to be user-updated. The categories and subcategories are easily updateable and easily understood by the non-technical, the only rule being that you don't leave blanks in the middle of your lists. In my working version, of course, the category table was on a separate "Menu" tab.
This is (a slightly simplified version of) the layout I came up with:
And these are the named ranges in the example:
category is the category cell
cats is the row that holds the list of available categories
DDCats is the list of categories for the drop-down, dropping blanks
mods is the full grid of subcategories/modifications
modlist is the dynamically chosen column of mods, dependent on the chosen category
DDMods is the list of mods for the drop-down, dropping blanks