Forum Discussion
How to create a dynamic hyperlink based on a changing cell reference in a different worksheet.
=HYPERLINK(“#Sheet2!A”&
COUNTA(Sheet2!A:A),”Sheet2!”&
COUNTA(Sheet2!A:A))
Note that the name of the link in the foregoing formula is the address of the cell in Sheet2 to which the link will jump.
Thank you for your response. i get the attached message when i put in the formula.
This is the formula i typed in =HYPERLINK(“#Hours!K”&COUNTA(Hours!K:K),”Hours!”&COUNTA(Hours!K:K))
Thank you!
sheet2 is hours
K is the column in sheet2
- TwifooMay 30, 2019Silver ContributorI didn’t test the formula because I replied to you via mobile phone. I will correct the formula after I get some sleep.
- TwifooMay 31, 2019Silver Contributor
The formula is correct! I surmise you copied and pasted my suggested formula, and then you modified it. Instead, please type this formula yourself:
=HYPERLINK("#Hours!K"&COUNTA(Hours!K:K),
"Hours!K"&COUNTA(Hours!K:K))I suspect the formula might have included some invisible characters when you copied and modified it. Also note that, in my originally suggested formula, I inadvertently omitted the Column Letter in the friendly_name argument of HYPERLINK. Such omission is irrelevant in determining whether the formula works because the friendly_name argument is optional anyway. Nonetheless, I have accordingly included the Column Letter "K" in the formula above, which I want you to manually type, rather than copy and paste.