ExcelFunctions.net

Excel HYPERLINK Function

Home » Excel-Built-In-Functions » Excel-Lookup-And-Reference-Functions » Excel-Hyperlink-Function



Basic Description

The Excel Hyperlink function creates a hyperlink to a document in a supplied location.

The syntax of the function is :

HYPERLINK( link_location, friendly_name )

where the arguments are as follows:

link_location - The address of the file to link to.
friendly_name - The text to display in the Excel cell.

The address supplied for the link_location argument can be an absolute reference or a relative reference. The difference between these two reference types is shown in the table below.

Absolute Reference

Shows the entire path to the referenced file

eg.

C:\Documents and Settings\User1\ExcelFile1.xlsx
Relative Reference

Refers to the referenced file's location relative to the current directory.

eg. if the current Excel file is located in C:\Documents and Settings, then the relative reference:

User1\ExcelFile1.xlsx

is equivalent to the absolute reference

C:\Documents and Settings\User1\ExcelFile1.xlsx
Also, within a relative reference, ..\ is used to specify the directory above the current one. eg. if the current Excel file is located in C:\Documents and Settings, then the relative reference

..\ExcelFile1.xlsx

means "move up one directory and from there, access the file ExcelFile1.xlsx"

This is equivalent to the absolute reference

C:\ExcelFile1.xlsx

Hyperlink Function Examples

Excel Hyperlinks are an excellent way of organising your data. This is shown in the spreadsheet the right, which collates details of sales invoices, and uses the Excel Hyperlink function to create links to individual invoices. The spreadsheet below shows the functions used to create the hyperlinks :

Example of use of the Excel Hyperlink Function

As the current spreadsheet is located in the directory C:\Invoices, the Excel hyperlink functions in cells B2 and B3, create links to the invoice files Invoice_B001.pdf and Invoice_B002.pdf, which are both located in the directory C:\Invoices. The result is shown in the spreadsheet below :

Example of use of the Excel Hyperlink Function

The hyperlinks in cells B2 and B3 allow you to open up the files Invoice_B001.pdf and Invoice_B002.pdf simply by clicking on the cells B2 and B3.

Note that, in this example, cell B2 uses an absolute reference, while B3 uses a relative reference. As the current spreadsheet is located in the directory C:\Invoices, the relative reference in cell B3 links to the file C:\Invoices\Invoice B002.pdf.

Further information on the Excel Hyperlink Function is provided on the Microsoft Office website.