Creating a Dynamic Hyperlink

by Allen Wyatt
(last updated October 22, 2020)


Mark wonders how to create a hyperlink to a worksheet in the same workbook. The name of the worksheet will change, so he thinks the link will have to be "dynamic." He would also like the "friendly name" for the hyperlink to change with the worksheet name.

There are a few ways that this can be approached. The first is to create a simple hyperlink to the destination using the HYPERLINK function. The syntax for the function is as follows:

=HYPERLINK(link_location, [friendly_name])

Note that the second paramaeter (the friendly name) is optional but should be used in Mark's scenario. If you want to link to another worksheet, then all you need to do is provide the address of a cell on that worksheet, in this manner:

=HYPERLINK("[myWorkBook.xlsx]MySheet!A1", "Jump There")

This provides a hyperlink to cell A1 on the worksheet named "MySheet." This works great, provided that there is no name change to "MySheet." If the name is changed or if the referenced cell is deleted, then the hyperlink no longer works.

There is an easy way to get around this potential problem, but it introduces a new potential problem. You can create a named range on the destination worksheet, and then use the named range in the HYPERLINK function, in this manner:

=HYPERLINK("#MyRange","Jump There")

Note that the range name must be preceded by a # sign and enclosed in quotes. Clicking the link displays whatever worksheet contains the named range and selects that range. It is more versatile than the earlier approach because it doesn't matter if you rename the worksheet containing the named range. It does matter, however, if the named range is deleted. (If only a part of the named range is deleted, Excel adjusts fine. It only balks if the entire named range is deleted.)

To get around all of these problems requires the use of helper cells. (You could also use a simple macro or two, but that may be overkill for Mark's needs.) As an example, put the following into cell A24:


The cell will show whatever is in cell A1 on MySheet. If you later change the name of MySheet (the actual sheet name), then the formula automatically changes. If you insert or delete rows or columns in MySheet, the reference to cell A1 in the formula won't change. This allows you to always have a valid worksheet and cell reference. In order to get that reference into a form that you can use in the HYPERLINK function, place the following formula in cell B24:


The FORMULATEXT function converts the formula in cell A24 into a text string and the addition of the MID function pulls off the equal sign from the front of the formula. The formula, as shown, allows for very long worksheet names, up to 96 characters (the other three characters are "!A1"). You can then use the following formula to create the actual hyperlink:

=HYPERLINK("[myWorkBook.xlsx]" & B24, "Jump There")

The hyperlink target is always dynamic and stable, which is exactly what is needed. It should be noted, though, that the FORMULATEXT function was introduced in Excel 2013; it won't work in earlier versions of the program.

I haven't spent much time talking about the friendly name portion of the HYPERLINK function. That's because you could easily change it to reference just about anything you want. You could, for instance, have it reference a different cell which, in turn, displays a value based on whatever formula you desire:


This example grabs the friendly name from whatever is in cell A7. Change what is in cell A7, and the friendly name updates at the same time.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13034) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Office 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...


Context Menus, Spell Checking, and Common Tasks

Automatic Spell Checking can change your menu options.

Discover More

Developing Reciprocal Conversion Formulas

When converting between measurement systems, you might want to use two cells for each type of measurement. Make a change ...

Discover More

Inserting Footnotes Using Custom Footnote Marks

Automatic footnotes are easy to insert in Word documents. The default settings are usually fine for most projects. ...

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

More ExcelTips (ribbon)

Hyperlinks in Shared Workbooks

Inserting a hyperlink into a workbook that is shared with others is not possible in Excel. Here's what you can do about it.

Discover More

Can't Use Hyperlinks

Before some features in Excel can function properly, you must have the correct permissions set for the user of the ...

Discover More

ScreenTip for an Image

You can configure images in Excel so that if someone clicks on them, a macro is executed. You cannot, however, have a ...

Discover More

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.


If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 2 - 2?

2020-05-26 10:31:16


Dear Mr.Wooley,

Thank you very much, it works fine with =hyperlink("#'swim'!John").

I was surprised by your super-fast Response.

Best regards,


2020-05-26 09:59:43

J. Woolley

Your problem has to do with the scope of your defined name (named range) John. When you use Formulas > Name to define a name, you can give it Workbook or Worksheet scope. If John is defined in sheet 'run' with Worksheet 'run' scope, then when you copy sheet 'run' and name the copy 'swim' you should be able to reference #'swim'!John and #'run'!John separately.

With respect to hyperlinks, you might be interested in the SuperLink function described here:

2020-05-25 12:21:38


Dear Mr.Wyatt,

I want to create a jump table based on Hyperlinks to several Worksheets in one Excel Workbook. This master Worksheet could be named 'results'.

E.g. there are 3 persons Karl, John, Paul and 3 disciplines like run, swim, cycle.

In each worksheet there should be additional informations like photos and so on, so it makes sense to jump to the Hyperlink from the Worksheet 'results'.

Now I am not willing to create a Name in each of the worksheets 'run', swim, cycle separately, but I create them once in the sheet 'run' like Karl, John, Paul. By copying run to 'swim' I find out, that luckily there is a new name swim!John. Unfortunately I am not able to address like =Hyperlink("#swim!John") from the 'results' worksheet.

Do you have a solution for this Problem?

Sincerly yours,

Christoph Fankhauser

2018-10-11 09:47:38


I am struggeling with hyperlink formula.
CELL D2= M02 (txt)
CELL E2=HYPERLINK("#" & D2 & "!A1";"View")
In my worksheet there is a sheet named M02. In this case no problem, the hyperlink works fine.

But when my sheet named M02 is in another Worksheet, what fomula do I need to use?

=HYPERLINK("[C:\documents\test\Test matrix M.xlsx]D2!A1";"View")
I tried this one but it does not work properly. It does send me to the Worksheet Test matrix M.xlsx but not to the sheet M02

=HYPERLINK("[C:\documents\test\Test matrix M.xlsx]"#" & D2 & "!A1";"View"
This did not work.
Do you have a solution for this by any chance?

2017-12-08 11:50:54


Don, for your example, I was able to retrieve the filename using this formula: =MID(FORMULATEXT(A62),48,(LEN(FORMULATEXT(A62))-57))

2017-12-08 11:40:53


Thanks Allen and Bryan, fun stuff! There is a small typo in Allen's 5th formula...=MID(FORMULATEXT(A24),99) should be =MID(FORMULATEXT(A24),2,99).

2017-12-08 11:27:39

Don Hornbrook

In my home bookkeeping system, I scan a copy of each credit card receipt and then add a Hyperlink reference at the end of each line:

My working hyperlink formula looks like this:

=HYPERLINK("c:\users\CurrentDocs\2017 Receipts\WholeFoods_171201.pdf","Image")

At year end, when I archive the entries, I don’t want to preserve the entire Hyperlink formula, but only the filename, in this case: WholeFoods_171201.pdf

I thought a simple Mid() formula would do the trick, something like Mid(R215,63,(LEN(R215)-72)), but the formula operates on the Displayed Text in the cell (“Image”) and not the hyperlink formula itself.

I thought I’d try to write a UDF that stripped out all but the filename reference, but my understanding of how to pass range or cell references to a Function seems to be lacking.

I was successful in writing a Sub that places a single quote in front of the formula in the next column to the right:

Sub ShowHyperlink()
ActiveCell.Offset(0, -1) = "'" & ActiveCell.Offset(0, -1).Formula
End Sub

and then I wrote the Mid() formula in the next column, but that takes two steps and two columns, and I would like to do everything with a UDF in a single step, something like: =ShowFileName(S215).

Can this be done in a UDF?

2016-10-07 04:27:21


Great, thank you, Allen!

2016-07-17 05:23:35


How do we create a dynamic hyperlink to a cell value so that on click of that value focus should jump to this value in single worksheet where its details are present

2016-01-25 22:55:50

Sourin Sett

i was wondering how to create dynamic hyperlink to a particular cell of another xlsx file in the same folder?

2016-01-25 17:24:39


I was wondering if you knew a way to incorporate this into a hyperlink to open another seperate workbook/spreadsheet to a named range.

~ Thx.

2016-01-20 06:32:52


"This tip (13034) applies to Microsoft Excel 2007, 2010, and 2013."

FORMULATEXT is worksheet function in Excel 2013+

2016-01-19 05:36:56

Sukhpal Singh

Hi Allen,

I am having trouble figuring out why after putting multiple hyperlinks in a worksheet, it continues to re-direct me to the latest hyperlink i have created- the same link for each different link.

I would grateful if you can advise me.

Thank you.

2015-09-21 14:12:40


how can i create a hyperlink to sheet by referencing a cell value? my main sheet column A has index numbers 1, 2, 3 etc. My sheets are named 1, 2, 3 etc.

2015-09-10 02:59:10

Jeff Brown


Is there a hyperlink formula i can use that will open either a JPG or PNG file.

my current formula is;
=HYPERLINK(CONCATENATE("T:MarketingCosting TemplateImages",F5,"",D5,".jpg"),"View")

obviously this will only open the .jpg file. how do i adjust this so it can open the file regardless of whether it is saved in JPG or PNG format?


2015-07-13 01:16:14


I want to do a statement in excel and want to put a specific cell reference in between the statement, is it possible if yes how

2015-04-02 20:29:04


I have solved the problem i posed a couple of days ago. I am embarrassed as to how simple it was.
If anyone is interested...

=Hyperlink(index(Array,Row,Column)) and manipulating the second and third arguments by calculation. I.e the row or column can become a constant depending what you wish to achieve.

2015-04-01 22:21:16


I have been using the following hyperlink for a long time now without any problems. However, I now wish to reference a row; rather than a column and then calculate the column number instead of the row number.
Present dynamic hyperlink:
Destination: is column C at row number specified in cell Z9.

Can you help?

2014-10-02 00:48:35


I want to make a formula where I provide a web site and it's dynamic variable like this:
Sample cell A1. Value 12345[A1]

the result must be an internet clickable hyperlink on the spreadsheet like this:


2014-03-28 07:02:13


Don: I agree that deletions shouldn't be an issue for the developer -- they should cause just as much trouble with any of these formulas than they would with anything else.

And ooops! Thanks for catching the typo. You managed to expose a secret about how I develop formulas: I break them into multiple cells, then combine them at the end.

2014-03-27 15:23:18


Let me start by saying I learned a load from this tip, both the original from Allen and feedback from Bryan. When I saw the request from Mark I got stuck at the problems in using the Insert Hyperlink function in the UI, and reverted to thinking about VBA and workbook/worksheet events.

In my mind this is the kind of feature that would be built near the end of the development cycle, after formulas and headers and the input cells are all defined it seems like the likelihood of the deletion of target ranges would be slight, i.e. the developer would know what ranges would be in danger of deletion and protect the target ranges before release to the users.

There is one typo in Bryan's formula: an extra equal sign in the middle. Otherwise, it worked beautifully with just a copy/paste and editing for the name of the worksheet.

2014-03-24 09:27:14


1) You've got a typo in the 5th paragraph ("Yu instead of "You").

2) Helper cells don't get around "all of these problems" -- there's no solution to the "linking to a deleted cell" problem. The only way to get around this problem would be to have your cell reference as A1:XFD1048576... which still will throw an error if you delete all the cells in the sheet.

3) If you use the CELL function, you don't need to use the multi-helper-cell solution: =HYPERLINK(CELL("address",MySheet!A1), "Jump There")

4) The problem statement sounds like Mark wants the friendly name to be the target worksheet name, so the entire formula would be: =HYPERLINK(CELL("address",MySheet!A1), =LEFT(MID(CELL("address",MySheet!A1),FIND("]",CELL("address",MySheet!A1))+1,9^9),FIND("!",CELL("address",MySheet!A1))-FIND("]",CELL("address",MySheet!A1))-1))

4a) My formula in step 4 is a good candidate for helper cells/named ranges, since the same calculation is done repeatedly. Using named ranges, the formula would be: =HYPERLINK(wkst_address,wkst_name)


wkst_address = CELL("address",MySheet!A1)

wkst_name = MID(wkst_address,l_pos,r_pos-l_pos)

l_pos = FIND("]",wkst_address)+1

r_pos = FIND("!",wkst_address)

2014-03-24 09:10:59


Awesome! THANKS Allen!

This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.