I have created several hyperlinks in a column, which links to another spreadsheet of the same workbook. Over there all the cell references are also in a column. Now i want to insert a row on the second page on the top of the sheet. As I do that the cell reference doesn't change and the previous cell figures drops down. How can i update multiple cell reference automatically as I insert row on top of the second sheet?
I am not sure of your specific situation but this is how I interpreted what you wrote:
If this is off, let me know.
With that said, ensure that you aren't using absolute cell references in your first sheet.
Absolute cell references are denoted with a $ in font of either the column, row, or both.
Here is a reference from MS on Absolute, Relative, and Mixed cell references: https://support.office.com/en-us/article/Switch-between-relative-absolute-and-mixed-references-dfec08cd-ae65-4f56-839e-5f0d8d0baca9
Related
I'm hoping someone can help me make better use of the INDIRECT formula.
I have a list of sheet names in a table and an INDIRECT formula that uses that list to return a value in a specified cell - the list of sheet names is just an easier way for me to drag the formula down the table and read the appropriate cells without having to manually link each sheet.
=INDIRECT("'"&A2&"'!"&"K10")
This works fine for single cells as the range ref is simply stated as the text in the formula (K10), the problem arises when I need to start referring to a range such as K10:K15 and summing the values.
The range K10:K15 will inevitably have new rows added or deleted on the relative tab and as INDIRECT is using text as the reference it means the range doesn't automatically adjust - this is as I understand it one of the 'benefits' of INDIRECT but in this case is actually holding me back.
Also worth noting that the range (K10:K15) may move as rows are added/deleted above this, as this range is part of a larger table.
In simplistic terms I want to achieve the same result as a standard reference to a range on another sheet, e.g. =sum(sheet1!K10:K15) (as this will adjust when rows are added/deleted) but I just want to be able to dictate which sheet is referred to via a list I have in a table on a summary sheet.
How do I either write INDIRECT so the range adjusts when new rows are added/deleted or is there a different formula I should be using that achieves this?
Any advice greatly appreciated :)
=INDIRECT("'"&A2&"'!K"& MATCH(TRUE,INDIRECT("'"&A2&"'!K:K")<>"",0)&":K"&MAX((INDIRECT("'"&A2&"'!K:K")<>"")*(ROW(INDIRECT("'"&A2&"'!K:K")))))
This indirectly references the rows from the first non empty cell up to the last non empty cell in given sheet in column K. Not sure if you need to enter with ctrl + shift + enter (not in the app version).
Note: If the range contains empty cells in between the first and last non empty cell it will be included as value 0
Or in office 365 use the following:
=FILTER(INDIRECT("'"&A2&"'!K:K"),INDIRECT("'"&A2&"'!K:K")<>"")
I have the following search function:
=ALS((VERT.ZOEKEN(B6;'Raw Data'!$H$1:$BB$3000;21;ONWAAR))=100;"Winkel";
ALS((VERT.ZOEKEN(B6;'Raw Data'!$H$1:$BB$3000;21;ONWAAR))=400;"Woning";
ALS((VERT.ZOEKEN(B6;'Raw Data'!$H$1:$BB$3000;21;ONWAAR))=500;"Parkeerplaats";
ALS((VERT.ZOEKEN(B6;'Raw Data'!$H$1:$BB$3000;21;ONWAAR))=200;"Kantoor";
ALS((VERT.ZOEKEN(B6;'Raw Data'!$H$1:$BB$3000;21;ONWAAR))=600;
"Antenne";"Overig")))))
But when I change and delete some of the columns in the range of the Vlookup search with a macro (Vert.Zoeken=Dutch for Vlookup) The Range specified within the formula changes.
Why does it do that, and how do i stop it? I Couldn't find a clear answer anywhere else.
(The macro code just deletes some columns, and doesn't do anything else really)
Cell ID vs Cell Location
One of Excel's primary mechanics is that each cell effectively has its own "ID", which is represented by that the location of that cell at the time that it was referenced. The location of that cell can change, when columns & rows are manipulated.
For example: in A1, make the formula
=B5+D3
Then insert a row above row 3, and a column to the left of B. Your formula will now read:
=C6+E3
You'll notice that because the locations of the unique cells was changed, the formula accounted for that. This feature is incredibly useful, as otherwise, even simply formulas would need to be completely re-written if a new header was inserted above some numbers.
If you want the position of a reference to be "absolute" in the sense that it always points to the same location instead of the same cell ID, then you have a few options:
VBA solution to ignore this feature
By its nature, VBA code does not automatically adjust when cell references change. If you have a formula which references Range("B5"), then it will still say Range("B5") after you insert a new column to the left of B. In this way, you could use VBA to build the formulas within your worksheet. ie: VBA could re-write the formulas to reference the columns you want it to.
Excel solution to ignore this feature
To solve this without VBA, meaning your VBA code would not need to re-write the formulas, you could use the INDIRECT function. INDIRECT allows you to dynamically determine what a cell reference is, based on building a text string of a location. For example:
=VLOOKUP(A1,INDIRECT("B"&5+10&":D100"),2,0)
This will create the text string "B15:D100", and that will be the range referenced by VLOOKUP. Because you have entered the "B" & "D" as text values, they will not change when you insert rows/columns.
I am making a series of cascading dropdowns in Excel. When a user selects an option in ColumnB, the sheet finds a list "Name"d = ColumnB value and set the validation for that column with that list.
It is working fine
But when I drag the cell in the whole column and try applying the Data Validation property to all cells, instead of selecting the previous cells respectively, it is defining every Data Validation property with the specific cell with which the first cell was binded.
It is not much of a problem as I can do that for individual cell, but I will be setting the data and names through code later, so I need to find a way that every Data Validation source contains a reference to its previous cell instead of that one specific cell.
Remove the $ sign. $ sign means that the reference is absolute and the cell reference in the formulas won't change when the cell is dragged or copied.
Another solution is to define the data validation for the entire column and you don't have to drag anymore.
I'd like to know if it is possible to link two sheets so that if I add a row in one sheet it autmatically gets added to the second sheet.
Thanks.
Not exactly -- I'm pretty sure you can't link an entire sheet. But you could use formulas with cell references, e.g. =Sheet2!B2 refers to cell B2 from Sheet2.
You could also try the vlookup() formula function. If you have a table defined somewhere in the workbook, you can use this function to return the value from one column of the table based on the supplied value from another column in the table.
You can "Group" sheets together by holding down CTRL and selecting the tabs of the sheets to be grouped. Adding and deleting rows and columns would result in the same treatment over all the selected sheets. But this is temporary and is lost as soon as another sheet is selected or the file is closed.
For a longer term entanglement, you would need VBA code.
I have a spreadsheet where I want cell formula to always look at a specific cell, even if rows or columns are inserted and the specific cell moves. Effectively, I always want to look at the 'top' cell of a table, even if new rows are inserted at the top of the table.
eg. Cell A2 has the formula[=$E$2]
Now I highlight row 1 and do Insert Row. The formula in A2 now says [=$E$3] but I want it to be looking at the new row 2.
The dollars will keep an absolute cell reference no matter what I do to the 'referencing' cell, but I want the cell reference to be absolute no matter what I do to the 'referenced' cell. If that makes sense!
Effectively, I have a 'table' in excel 2007 and I want to always reference the top row. The trouble is that rows are added to this table from the top so the top row keeps moving down to make room for a new top row.
--- Alistair.
Try =indirect("F2"). This will work if you know that the top-right cell of the table is always going to be $F$2.
You could also use the Offset Function:
http://office.microsoft.com/en-us/excel-help/offset-function-HP010342739.aspx
or
https://support.office.com/en-us/article/offset-function-c8de19ae-dd79-4b9b-a14e-b4d906d11b66
Building on #ktdrv's answer (I can't comment): =indirect("F"&ROW()) would be $F2 if it's a reference that needs to be dragged down multiple rows. A minor drawback with =indirect() is that you lose cell reference highlighting for the formula.