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.
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 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.
I have an Excel workbook that contains a number of individual worksheets. The cells on one of the sheets are linked to individual cells on other worksheet in the same workbook. I'm using a direct cell reference that essentially says that whatever value is entered into a particular cell on one sheet also populates cells on the other sheet. I used the (=) function with the cell reference to accomplish this.
The issue I'm running into is that, even when the primary cell is left blank, the cells that populate from that primary cell will display 0, rather than a text that I want to be display like: "No data here" .
I want the subordinate cells to display "No data here" if the primary cell they're linked to are blank.
Is there a way of doing this?
Use the ! operator to reference cells on other worksheets.
So you can construct the formula like this:
=IF(Sheet1!A1="","Source cell is blank",Sheet1!A1)
Obviously, replace "Sheet1" with the name of your source data sheet.
I have an Excel sheet in the following format :
I want to have a second tab that uses this data and generates a table in this format
I was wondering if this can be done without VBA ? if not, any idea how should I best approach it ?
Thanks
Suppose you have the following named ranges:
Type_A being all data in column Type_A;
Type_B being all data in column Type_B;
Type_C being all data in column Type_C;
Cat_1 being all data in column Category_1;
Cat_2 being all data in column Category_2;
Functions being all data in column Functions.
In cell B8, enter the following array formula (which needs to be confirmed by pressing Ctrl+Shift+Enter on your keyboard upon finishing the formula in the formula bar):
=TEXTJOIN(CHAR(10),1,IF((INDIRECT(B$7)="X")*(INDIRECT($A8)="X"),Functions,""))
Then highlight the output table and click Wrap Text button under Home tab to display the outcome with line break within the cell.
TEXTJOIN function is only available in Excel 365 and later versions.
A tip here, you can highlight your source table (including headers) and press Ctrl+Shift+F3 on your key board to quickly set the column header (top row) as the name for each range. Then you just need to set up the first row and first column with all types and categories for your output table, and use the above formula to return the desired output.
Let me know if you have any questions. Cheers :)
I'm using Index-Match to match Full Names with head count in that party.
I have it working but it uses both the structured and explicit cell reference.
I can't figure out why when I add a new row in my table, the column with the index-match formula wont populate the last row.
This is the formula used:
=IFNA(INDEX(AA:AA,MATCH([#[Preferred Seating 1st Choice]],D:D,0)),"")
Column AA has the head count number and column D has the list of full names.
Preferred Seating is the column used to reference the search.
I looked around and can't seem to find why it wont fill in the last row after that rown info is entered.
I can only assume it has something to do with the mixed Explicit-structured cell/column references. Any help please.
Yes Excel may not automatically assume a formula needs to be automatically filled in an entire table column if it contains unusual references. Unless you have data outside the table, you should just refer to the columns in the table:
=IFNA(INDEX([Column AA Name],MATCH([#[Preferred Seating 1st Choice]],[Column D Name],0)),"")
These can be easily entered when editing the formula by selecting all cells in the source columns excluding the heading. The formula will always use the entire
source columns and the formula should automatically fill its own entire column.
You can also control whether a column automatically has its formula updated through a hidden property. The ability to change the behavior of the column only appears through the front end when you're making changes to the column.
After entering a formula in a column, Excel will either automatically fill the entire column and give you the option to turn off the automatic fill, or Excel will not automatically fill the entire column and give you the option to turn it on.
After entering a formula that isn't being filled, this icon will appear:
Click it and then select to Overwrite all cells in this column with this formula
Deleting a formula from one cell in a column that is being automatically filled will turn off the automatic fill. Double clicking a cell with a formula and pressing enter will give you the option to turn it on again.