How to Use Hyperlinks in Google Sheets

This guide explains how to easily create and manage hyperlinks in Google Sheets. An entire cell on the sheet, or specific text inside the cell, can link to external web pages. A cell can also contain several hyperlinks.

If you type a webpage address into a Google Sheet cell, it automatically converts to a clickable hyperlink.

You can add anchor text to single hyperlinks for more accessible URLs. Hover your mouse over the hyperlink and click the edit icon. Now add the anchor text in the text input box and click the green Apply button.

Alternatively, you can use the HYPERLINK function in Google Sheet to create web links with anchor text (optional).

 =HYPERLINK("", "Digital Inspiration")

Add anchor text to hyperlink

It is also possible to include multiple hyperlinks in a single Google sheet cell.

Just type any text, include URLs in plain text, and when you move the cursor out of the cell, the URLs are converted to hyperlinks.

Bonus Tip: When a cell with multiple links is selected, press Alt+Enter and all links open at once in new tabs.

Multiple hyperlinks in Google Sheet Cell

You can use the previous technique to edit multiple hyperlinks contained in a single cell and add anchor text.

Hover your mouse over a link in the cell, click the edit icon, and edit the anchor text. Repeat this for all other links in the same cell.

Format multiple URLs

See also Google Drive Secret URLs.

Here are some snippets that will help you manage your hyperlinks in Google Sheets using Google Script macros.

const createHyperLinkWithFormula = () => {
  const link = '';
  const text = 'Digital Inspiration';
  const value = `=HYPERLINK("${link}", "${text}")`;
  const sheet = SpreadsheetApp.getActiveSheet();
  const range = sheet.getRange('A1');
const createHyperLinkWithRichTextValue = () => {
  const link = '';
  const text = 'Digital Inspiration';
  const value = SpreadsheetApp.newRichTextValue().setText(text).setLinkUrl(link).build();
const createMultipleHyperLinks = () => {
  const value = SpreadsheetApp.newRichTextValue()
    .setText('Google acquired YouTube in 2006')
    .setLinkUrl(0, 6, '')
    .setLinkUrl(16, 23, '')
const extractLinkFromFormula = () => {
  const sheet = SpreadsheetApp.getActiveSheet();
  const range = sheet.getRange('A1');
  const formula = range.getFormula();
  const [, url, , text] = formula.match(/=HYPERLINK("(.+?)"([;,]"(.+?)")?)/) || [];
  Logger.log({ url, text: text || url });
const extractMultipleLinks = () => {
  const urls = SpreadsheetApp.getActiveSheet()
    .map((run) => {
      return {
        url: run.getLinkUrl(),
        text: run.getText(),
    .filter(({ url }) => url);

See also: Extract hyperlinks in Google Sheets

Comments are closed.