I have the following table:
Is there a way to have dynamic drop-down list including all values from only same cluster (example of possible values in Link list column)? Cluster column is big so I am looking for dynamic solution.
So you can do this with formulas, but it's a bit involved. Bottom line is that here is the result I came up with:
The drop-down was created dynamically using dynamic named ranges and formulas
We need to start out with some definitions. This is my test worksheet and data:
The formulas will work out using the named ranges, so you can put your "working area" (the boxed area in green) almost anywhere, including on a different (possibly hidden) worksheet.
You must define four, dynamic named ranges as follows, which match the color-shaded areas in the image above:
Many of these formulas are array formulas, so you must be careful to enter them with CTRL+SHIFT+ENTER.
Once your data areas and names are defined, the first area to populate is the UniqueClusterList (the range on the sheet is F2:M2). We're building a list of unique items, based on the data in your column of cluster values. So you need an array formula that identifies all the unique values in the range. In each cell in the range, enter the array formula CTRL+SHIFT+ENTER for each:
Cell F2 =IFERROR(LOOKUP(2,1/(COUNTIF($E$2:E2,ClusterList)=0),ClusterList),"")
Cell G2 =IFERROR(LOOKUP(2,1/(COUNTIF($E$2:F2,ClusterList)=0),ClusterList),"")
Cell H2 =IFERROR(LOOKUP(2,1/(COUNTIF($E$2:G2,ClusterList)=0),ClusterList),"")
Cell I2 =IFERROR(LOOKUP(2,1/(COUNTIF($E$2:H2,ClusterList)=0),ClusterList),"")
... and so on. Notice that only the cell address in the middle is changing.
Next, we need to build up the list of IDs for each unique Cluster value. This is also an array formula. Starting in cell F3 with CTRL+SHIFT+ENTER:
=IFERROR(INDEX(IDList, SMALL(IF(F$2=ClusterList, ROW(IDList)-2,""), ROW()-2)),"")
Then use your cursor to grab the auto-fill icon in the selection box of that cell and drag it down to cell F16. Since cells F3:F16 are now selected, re-grab the auto-fill icon and drag to the right to fill the whole range F2:M16. All of the values should pop-in as calculated by the formulas.
Your final step is to create the lookup formula for the drop-down list. So select cell C3, then on the ribbon click Data --> Data Tools --> Data Validation to get the dialog window. Now select Allow: List, and in the Source: field enter the following formula:
=OFFSET($F$2,1,MATCH(A3,UniqueClusterList,0)-1,SUMPRODUCT(COUNTIF(IDList,OFFSET($F$2,0,MATCH(A3,UniqueClusterList,0)-1,MAXUNIQUE,1))),1)
You'll now have a drop-down in cell C3 that matches the very first image above. Drag the auto-fill selection icon all the way down to cell C20 and all of those cells will correctly calculate the drop-down list based on the available Clusters and IDs.
Related
Looking to make a dynamic dropdown list in a table. The photo link below should help visualize the problem.
What I am looking to do is create a dynamic dropdown list in one table using a column from the same table and two columns from a second table in another sheet.
The column with the dropdown should compare the column to the left of it to right column of the second table. The options in the dropdown should be the values in the left column of the second table if the cell to the left of the dropdown cell equals the cell to the right of the value cell in the second table.|
The photo below shows the table setups and the numbers next to the top left table show what options that should be in the dropdown.
Edit: I was looking to do this without using Visual Basic, but I would be open to it if it were the only option.
This is called dependent data validation. You need to set up range names. One for each reference, and an additional one to resolve the reference into a dropdown using Indirect. I set up these four range names and for the data validation I used List > =MyDropdown
a =Sheet1!$H$2:$H$5
b =Sheet1!$H$6:$H$8
cc =Sheet1!$H$9
MyDropdown =INDIRECT(Sheet1!$A2)
Note that the reference inside the INDIRECT() function is relative to the cell that was active when the reference is defined. Select cell in row 2, then create a new named range with that formula. If you select another cell, this will not work.
Note also that the named range cannot be called 'c', so I had to use another reference name.
As per above data setup put below formula to H6
=TRANSPOSE(UNIQUE(E6:E13))
Then put below formula to H7 cell and drag across right.
=FILTER($D$6:$D$13,$E$6:$E$13=H$6)
Above formulas will spill data automatically. Then in data validation for range A1:A10 put below formula
=H$6$#
# after H$6$ will take data dynamically output by Unique() formula till last data.
Then for range B2:B10 data validation formula will
=INDEX($H$7:$J$10,,MATCH($A1,$H$6#,0))
Dropdown result
I need your assistance with Excel. I have the following columns on my worksheet
EmployeeNumber, EmployeeName, SalesID,Email, EmployeeNumberID.
The EmployeeNumber and EmployeeNumberID columns are the key columns as these contain the employee number. The problem is that EmployeeNumber contains all employees from different departments and EmployeeNumberID contains employee from the Sales department.
Could you please assist with highlighting the EmployeeNumber that are not in the EmployeeNumberID column, if we could highlight the entire row that would be great.
Mnay Thanks
Assuming your data is layed out as per the image below, select the range from A2 to E9 and ensure that the upper left cell A2 is your active cell. Notice in the image the active cell has a light background compared to the grey background of the rest of the selected range.
Then go to your HOME ribbon and select conditional formatting.
From the drop down menu that appears select New Rule.
In the New Formatting Rule window that appears select "Use a formula to determine which cells to format" at the bottom of the list. Then click to format button and chose whatever formatting you want to have applied. I would recommend the Fill tab and then select a colour.
Enter the following logical check in the "Format values where this formula is true:" box:
=COUNTIF($E$2:$E$9,$A2)=0
It will count the number of times Employee number in column A occurs in Column E. It will then check to see if that count is zero meaning its not in column or not part of the sales team, and apply the formatting you selected early to all cells in the row from A to E. If you only want to colour cells in column A then select A2:A9 as your initial selection area for applying conditional formatting to. The equation should not need to change.
Proof of Concept
You just need some conditional formatting. Select the area you want to apply the highlighting to, lets say A:E, then use conditional formatting with the following formula:
=ISNA(MATCH($A1,$E:$E,0))
assuming EmployeeNumber is in column A and EmployeeNumberID is in column E.
What this does is tries to match the EmployeeNumber to a value in column E. If it fails, then it will return #N/A and ISNA will return TRUE and the row will be highlighted.
Note that $A1 should be the top left cell in the range you are formatting. If you start lower, adjust the cell accordingly.
I have the formula below that I'm using to link to a certain sheet and cell in my workbook that contains a graph for each entry. On the sheet I link too, each graph is about 20 cells down from the previous one. I have over a 100 graphs now and it will grow in time so I was trying to use the HYPERLINK formula rather than the Hyperlink button for this. I thought I would be able to just insert the formula in the first row, paste it in the second row with an added 20 cells, highlight the two and drag it down but it will not count in increments of 20.
Is this even possible?
=HYPERLINK("#'Trends'!A25","Click To View Trend")
I'm thinking you will have to use some type of concatenation to get the behavior you are after. To do this, you may want to employ a "helper" column. For example, put the "numbers" you are after in column B -- below you will see that I incremented it by 5.
Now your HYPERLINK formula in cell A1 is written as:
=HYPERLINK("[Book1]Sheet2!A"& B1,"Click Me for Sheet2, Cell A"&B1)
(Assuming the workbook is called Book1. Now, I can drag that formula down and it will update "dynamically" to account for the changes in column B.
I just needs some help on a formula to count the numbers of orders in the orders table for each customer.
Table Name = "Orders"
See the image:
So in another worksheet, the formula counts the orders for each individual customer.
I countn't get the countif to work as each amount of orders vary between customers. The PivotTable didn't work either as there are blank spaces in the customer numbers.
Any other solutions to my problem?
Quick way to fill the blank cells:
Select the cells from A5:C5 and all the way down the table
Hit F5
Click Special
Tick "Blanks" and hit OK
All blank cells in the range are now selected. Without changing the selection,
type a = sign
hit the up arrow key on your keyboard.
Hold down Ctrl and hit Enter
Now all previously blank cells contain a formula that references the cell right above. Copy the columns and paste them over themselves with Paste Special > Values to replace the formulas with the values.
Now you can build a pivot table for the count.
As an alternative to filling in the blank cells you could use a helper column with a formula along the lines of
=IF(LEN(B5)=0,H4,B5)
Start the formula in cell H5 and copy down. Now you can use a pivot table with this helper column. You can hide the helper column if it upsets your spreadsheet design.
Is there any way to ask excel to update the precedents of a formula if we provide all details like....
suppose in cell D1 = "=SUM(B1:B20)"
now after data got exported then we know that data is B5:B50
then how can we ask excel to update the formula in cell D1 like "=Sum(B5:B50)
or we will have to string replacements.
You could assign a name to the B1:B20 range: highlight B1:B20, the click on the name box (to the left of the formula bar) and type a name. You can then use that name in your SUM formula. When the data moves, update the location of the range on the Excel 2003 Insert menu, at Range > Define.
Alternatively, if the top-left cell stayed in the same place after the export (i.e. in cell B1), you could create an Excel list to represent the data: highlight B1:B20 and right-click on it, then click Create List. If you add rows to the bottom of a list, Excel automatically updates any formulae that refer to it.