Google Sheets function · Web and import
HYPERLINK in Google Sheets: syntax and examples
HYPERLINK turns a cell into a clickable link and shows the label you pick. The url can be typed, read from a cell or built with the & operator.
Syntax
HYPERLINK(url, [link_label])
Arguments
| Argument | Type | Required | What it does |
|---|---|---|---|
url | text | yes | The address to open, with the https:// part. It can also point inside the file, such as "#gid=0". |
link_label | text | no | The text shown in the cell. If left out, the cell shows the url itself. |
Examples
The examples use this table, starting in A1:
| Link | Query | |
| https://example.com | desk lamp | ana@example.com |
=HYPERLINK("https://www.google.com", "Google")Result: Google
A clickable cell that shows a short label instead of the address.
Run in a Google Sheet (English US locale) on .
=HYPERLINK(A2, "Open site")Result: Open site
The url comes from another cell, so one column of links can be reused.
Run in a Google Sheet (English US locale) on .
=HYPERLINK("https://www.google.com/search?q="&ENCODEURL(B2), "Search "&B2)Result: Search desk lamp
A search link built from a cell. ENCODEURL turns the space into %20.
Run in a Google Sheet (English US locale) on .
=HYPERLINK("mailto:"&C2, C2)Result: ana@example.com
A mailto link: a click opens the mail program with the address filled in.
Run in a Google Sheet (English US locale) on .
=HYPERLINK("#gid=0&range=A1", "Back to A1")Result: Back to A1
An internal link to a cell of the same file, using the gid of the tab.
Run in a Google Sheet (English US locale) on .
Common errors
- Without link_label the cell shows the whole url. Add a short label for a clean sheet.
- The value of the cell is the label, not the url. A formula such as LEN or a lookup on that cell sees the label text only.
- Query values with spaces or accents should go through ENCODEURL, which turns a space into %20.
- The url argument is required. Calling HYPERLINK with no arguments returns #N/A.
Compared with Excel
Same syntax as Excel HYPERLINK. Internal links use "#gid=0" in Sheets and "#Sheet1!A1" in Excel.