The HYPERLINK function in Google Sheets enables users to create a clickable link within a cell. This feature is particularly useful for integrating references to external websites, documents, and other sheets, enhancing navigation and interactivity in your spreadsheets.
Syntax
HYPERLINK(url, link_label)
- url: The web address or internal reference point; this defines where the hyperlink directs.
- link_label: The text that will be displayed as the hyperlink in the cell.
Example #1
HYPERLINK("https://www.google.com", "Go to Google")
This function creates a link that directs you to Google, with the text “Go to Google” displayed in the cell. For a practical example, if you enter this, clicking on the cell will open Google’s homepage.
Example result: A cell displaying: “Go to Google” which, when clicked, takes you to the Google homepage.
Example #2
HYPERLINK("https://www.example.com", "Visit Example")
This creates a hyperlink that leads to “example.com,” displaying the text “Visit Example”. Clicking the cell will seamlessly redirect the user to this website.
Example result: A cell showing “Visit Example” that navigates to example.com upon clicking.
Example #3
HYPERLINK("Sheet2!A1", "Open Sheet 2")
This function links to cell A1 in Sheet2 of the current Google Sheets file, with the label “Open Sheet 2”. It allows users to jump between different sheets in the document quickly.
Example result: A cell labeled “Open Sheet 2” that, when clicked, transports the user to the specified cell in Sheet2.
Error handling
- ERROR 404: Indicates that the specified URL cannot be found. This occurs when the link is broken or incorrectly typed.
- INVALID REF: This happens when referring to a sheet or cell that does not exist, typically due to typos.
- VALUE ERROR: Triggered when the inputs do not meet the required formats, such as missing quotes around the URL or link label.