I'm creating a large spreadsheet for my job and need to create an Index at the top which links to specific sections of the workbook. I know how to link to cells within a spreadsheet - however, this spreadsheet will be consistently adding and removing rows, meaning the cell numbers will be changing.
Is there a way to create a hyperlink to a specific value/word within a cell? For instance, can I create a link to a cell with the header phrase "Transactions List," that will always link their even if its cell number changes?
Yes, there is way. You can use Match() function within Hyperlink() function to refer cell dynamically. Lets demonstrate how to do. Suppose you have Transactions List (see attached screenshot below) word in Column F and you want to hyperlink that cell even when you add few rows before that cell. Match function will find row number of cell containing Transactions List in specified column and link to that cell by below formula.
=HYPERLINK("#F"&MATCH("Transactions List",F:F,0),"Hello Hyperlink")
Even you can hyperlink cell in another sheet by following formula. Change sheet name in your case.
=HYPERLINK("#Sheet2!F"&MATCH("Transactions List",Sheet2!F:F,0),"Hello Hyperlink")
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 am trying to find a way to reference a cell in VBA based on two other cells in the datasheet.
In the datasheet I have a domain (D) column e.g. "example.com" and I have a date column (A) e.g. 01/01/2017
In my main worksheet I have a table with domains in column A and the dates in row 10. I am trying to find a to pick the cell in the table that falls into the date and domain based on the record it is currently looking at in the datasheet
Using that first line of data here is the an image highlighting the cell which I want to select.
My plan is to then copy the detail from the [Pass] column into that cell, I am just having problem selecting that cell.
I've tried as many solutions as I can find on here, most using one set of criteria, but I cannot seem to get them to work for me in this situation.
Many thanks
Dummy data
edit - added dummy data - had to remove screenshot of the data as I can only upload two links
Assuming your Sheet2 is as follows
Then, in Sheet1 enter the following formula in Cell E2
=INDEX(Sheet2!$A$10:$AH$17,MATCH(D2,Sheet2!$A$10:$A$17,0),MATCH(A2,Sheet2!$A$10:$AH$10,0))
Drag/Copy down as required. Change range as needed. See image for reference.
EDIT : As per comment
Enter this formula in Cell Z14
=INDEX(Sheet1!$C$2:$C$5,MATCH(A14,Sheet1!$D$2:$D$5,0))
I am trying to figure out how to reference a worksheet name in my SUMPRODUCT cell and I can't figure it out. I am not sure if its because my logic is flawed and there is a better way or if what I want to do isn't possible without using VB code.
Basically I have a workbook that has various data. However for this instance I am only looking at a single column, in this case, the DATE. So I am basically using a SUMPRODUCT Formula to read the entire column for a date that is older than 120 days, but not counting items in the column that are blank. So just cells with a date in it.
This workbook will have worksheets added every month and the previous month will be stored. To make this workbook Dynamic, the first work sheet has various graphs to display information and so it can be printed nicely while the last page has all the formulas.
Basically I looking to create a drop down box on the first worksheet. That dropdown list will have the previous months (the worksheets are named by months), and ideally they will be referenced into the formula as it changes.
For example:
My current formula works: SUMPRODUCT(('OCT 2015'!$G:$G<TODAY()-120)*('OCT 2015'!$G:$G<>""'))
I would like the formula to like: SUMPRODUCT(('CELL_THAT_HAS_SHEETNAME'!$G:$G<TODAY()-120)*('CELL_THAT_HAS_SHEETNAME'!$G:$G<>""'))
And that cell it will reference is a dropdown list and corresponds to the sheetname.
You would incorporate the INDIRECT Function:
=SUMPRODUCT((INDIRECT(A1&"!$G:$G")<TODAY()-120)*(INDIRECT(A1&"!$G:$G")<>""'))
I am using a userform to input into an excel cell from a data validated list. Meaning. On the userform I start typing a location and it populates the userform then the data gets put into a cell. Now the question...How can I have that column on excel count and give me the number of locations without adding in the duplicate values. Can i do it inserting a function on a cell within excel or do I need a macro of sorts. Any suggestions how I can get a function to determine the number of different locations?
I searched and I am not sure if this was ever asked before. Thank you very much for your time.
Depending on the size of your data this can take a while to calculate, but this array formula will give you the number of unique entries in a range.
=SUM(1/COUNTIF(A1:A10,A1:A10))
Where A1:A10 is the actual range containing your data, of course. You must confirm the formula with ctrl+shift+enter. Or, in VBA, it's
Range.FormulaArray = "=SUM(1/COUNTIF(A1:A10,A1:A10))"
Edit: To account for empty cells try this:
=SUM(IFERROR(1/IF(NOT(ISBLANK(A1:A10)),COUNTIF(A1:A10,A1:A10)),""))
Again entered as an array formula.
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.