Author: Oscar Cronquist Article last updated on October 06, 2021

The HYPERLINK function allows you to build a link in a cell pointing to something else like a file, workbook, cell, cell range, or webpage.

You can then press with left mouse button on that link to open a file or quickly navigate to a location in a workbook.

1. Excel function syntax

HYPERLINK(link_location, [friendly_name])

Back to top

2. Arguments

Link_location Required. Depending on what you want to create a link to you have these options:

  • File - Full hard drive path to file and file name + file extension
  • File on a server - Full hard drive path to file and file name + file extension
  • File on the internet - HTTP/HTTPS address + filename and extension
  • Workbook - Full hard drive path to workbook and workbook name
  • Webpage - HTTP/HTTPS address
  • Bookmark in a word document
friendly_name Optional. A value or a cell reference used by the HYPERLINK function to show link text, in the cell. This argument is optional, the HYPERLINK function displays the link location if the argument is missing.

Back to top

3. How to select a cell containing a hyperlink?

To select a cell without performing the hyperlink action press and hold on the cell until a cross appears, see the animated image above.

Back to top

4. HYPERLINK function not working

The HYPERLINK functions first argument is not easy to type, there are a few things to remember:

  • full path if the workbook or file is not in the same directory as the active workbook
  • workbook name with leading and trailing bracket
  • worksheet name with leading and trailing single quote if the name contains a space character
  • exclamation mark between worksheet name and cell address

Below are common errors described.

Back to top

4.1 Reference isn't valid error

HYPERLINK function reference isnt valid

The image above shows an error that Excel returns if the worksheet name is missing or the worksheet name contains space characters.

HYPERLINK(link_location, [friendly_name])

The link_location argument must contain a reference to the workbook name, worksheet name, exclamation mark between worksheet name and cell address, and a cell address if you want to link to an item in a workbook.

Formula in cell B3 that returns an error:

=HYPERLINK("[HYPERLINK function.xlsx]Link to a cell!P1000", "Link to cell P1000")

Worksheet reference "Link to a cell" above contains space characters, use a leading and trailing single quote or apostrophe to avoid the "Reference isn't valid" error.

Formula in cell B3 that works:

=HYPERLINK("[HYPERLINK function.xlsx]'Link to a cell'!P1000", "Link to cell P1000")

Back to top

4.2 Cannot open the specified file error

HYPERLINK function cannot open the specified file

The image above demonstrates an error that is returned if the workbook name is missing in the link_location argument.

HYPERLINK(link_location, [friendly_name])

Formula in cell B3 that returns an error:

=HYPERLINK("'Link to a cell!P1000", "Link to cell P1000")

The link_location argument above doesn't contain a reference to the workbook name, use leading and trailing brackets to avoid "Cannot open the specified file" error.

Formula in cell B3 that works:

=HYPERLINK("[HYPERLINK function.xlsx]'Link to a cell'!P1000", "Link to cell P1000")

Back to top

4.3 Excel found a problem with one or more formula references in this worksheet

Hyperlink function error1

The image above shows an Excel error if the first argument in the HYPERLINK function is not correct.

The dialog box shows "Excel found a problem with one or more formula references in this worksheet. Check that the cell references, range names, defined names, and links to other workbooks in your formulas are all correct.

Formula in cell B3 that returns an error:

=HYPERLINK("[HYPERLINK function.xlsx]'Sheet1'!","Link to Sheet1")

The link_location argument above doesn't contain a reference to a cell.

Formula in cell B3 that works:

=HYPERLINK("[HYPERLINK function.xlsx]'Sheet1'!A1","Link to Sheet1")

Back to top

5. How to create a link to a cell

HYPERLINK function link to cell

The image above demonstrates how to link to a specific cell using the HYPERLINK function.

Formula in cell B3:

=HYPERLINK("[HYPERLINK function.xlsx]'Link to a cell'!P1000", "Link to cell P1000")

HYPERLINK(link_location, [friendly_name])

The link_location argument must contain a reference to the workbook, worksheet, and cell address. [friendly_name] argument lets you specify the hyperlink text to show in the cell.

Note the exclamation mark between the worksheet and cell address.

Back to top

6. How to create a link to a cell range

HYPERLINK function link to cell range

The image above demonstrates how to link to a specific cell range using the HYPERLINK function. The cell range is selected if you press with left mouse button on the hyperlink.

Formula in cell B3:

=HYPERLINK("[HYPERLINK function.xlsx]'Link to a cell range'!C6:G15","Link to cell range C6:G15")

HYPERLINK(link_location, [friendly_name])

The link_location argument must contain a reference to the workbook, worksheet, and a reference to a cell range. [friendly_name] argument lets you specify the hyperlink text to show in the cell.

Note the exclamation mark between the worksheet and cell address.

Back to top

7. How to create a link to another worksheet

HYPERLINK function link to a worksheet 1

The image above demonstrates how to link to a specific worksheet using the HYPERLINK function.

Formula in cell B3:

=HYPERLINK("[HYPERLINK function.xlsx]'Sheet1'!A1","Link to Sheet1")

HYPERLINK(link_location, [friendly_name])

HYPERLINK function arguments 1

Back to top

8. How to create a link to a workbook

HYPERLINK function link to workbook

The image above demonstrates how to link to a specific workbook using the HYPERLINK function.

Formula in cell B3:

=HYPERLINK("[TEXT function.xlsx]","Link to Text function.xlsx")

HYPERLINK(link_location, [friendly_name])

Note that a reference to the workbook name only is valid. Remember to reference the full path if the workbook is not in the same directory.

=HYPERLINK("[TEXT function.xlsx]","Link to Text function.xlsx")

Back to top

9. How to create a link to a named range

HYPERLINK function link to named range

The image above demonstrates how to link to a specific named range using the HYPERLINK function.

Formula in cell B3:

=HYPERLINK("[HYPERLINK function.xlsx]Named_range","Link to named range")

HYPERLINK(link_location, [friendly_name])

You need to specify the path, workbook name, and the name of the named range, the example above has no path specified. The workbook is in the same folder as the active workbook.

Read more about named ranges: Define and use names in formulas

Back to top

10. How to create a link to an Excel Table

HYPERLINK function link to Excel Table

The image above demonstrates how to link to a specific named range using the HYPERLINK function.

Formula in cell B3:

=HYPERLINK("[HYPERLINK function.xlsx]Table1","Link to Excel Table")

HYPERLINK(link_location, [friendly_name])

You need to specify the path, workbook name, and the name of the Excel Table. The example above has no path specified, the workbook is in the same folder as the active workbook.

Read more about Excel Tables

Back to top

11. How to create a link to a file

HYPERLINK function link to file

The image above shows how to link to a specific file using the HYPERLINK function.

Formula in cell B3:

=HYPERLINK("C:\temp\temp.pdf","Link to file")

HYPERLINK(link_location, [friendly_name])

You need to specify the path, file name, and file extension. The example above links to a pdf file named temp.pdf in a temp folder on harddrive c:\.

Back to top

12. How to create a link to a webpage

HYPERLINK function link to website

The image above shows how to link to a specific website using the HYPERLINK function.

Formula in cell B3:

=HYPERLINK("https://www.google.com/","Link to Google")

HYPERLINK(link_location, [friendly_name])

You need to specify the url to the website you want to link. The example above links to Google.

Back to top

13. How to create a link based on cell value

If you use a cell reference as an argument you can make the function dynamic. This allows the HYPERLINK function to change depending on the value in the cell that the cell reference points to.

Formula in cell D3:

=HYPERLINK(B3, C3)

You can create formulas that lookup a value and return a link to that value using this technique.

Here are some articles:
Locate lookup values in an Excel table [HYPERLINK]
Navigate to first empty cell using a hyperlink formula
Create a hyperlink linked to the result of a two-dimensional lookup
How to quickly find the maximum or minimum value [Formula]

Back to top

14. Excel file

Get the Excel file


HYPERLINK-function.xlsx

Back to top