Extract URLs from Hyperlinked Text in Google Sheets (Formulas vs Faster Workflow)
Google Sheets users have been trying to answer the same question for years:
> *"How do I extract the URL from hyperlinked text?"*
If you have cells where the text is something like:
but the actual URL is hidden behind Command + K or a right‑click “Insert link…”, a simple formula often does not work.
This guide walks through:
---
Quick steps
---
1. The classic REGEXEXTRACT formula
One common answer online suggests using `FORMULATEXT` and `REGEXEXTRACT` together.
The idea looks like this:
`=HYPERLINK("https://example.com", "Example")`
`=REGEXEXTRACT(FORMULATEXT(A1), """(http[s]?://[^""]+)""")`
What this does:
On paper, this seems like a neat trick. In practice, there are several problems.
Problem 1 – It only works on cells with formulas
The approach above assumes that the hyperlink was created with a formula such as `HYPERLINK("https://...", "Label")`.
Many modern sheets are not built this way. Instead, users:
This creates rich‑text formatting with a link behind it, not a formula.
When you run `FORMULATEXT` on a cell like that, it does not return a formula string with a URL. Depending on the cell, you may see:
There is nothing for `REGEXEXTRACT` to find, so the URL never appears.
Problem 2 – Slight changes break the regex
Even when a hyperlink is formula‑based, small variations can break the regular expression:
You may see variants online such as:
These can work in narrow cases but still fail when the sheet layout changes. Maintaining a delicate regex for URLs inside formula text quickly becomes fragile.
---
2. A script‑based workaround for rich‑text hyperlinks
Some answers go further and suggest using Google Apps Script. The idea is:
A simplified example looks like this:
`
function EXTRACTHYPERLINK(input) {
const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange(input);
const values = range.getRichTextValues();
return values.map(row =>
row.map(cell => cell.getLinkUrl())
);
}
`
`=EXTRACTHYPERLINK("A2")`
This reads the rich‑text values from the referenced range and returns the link URLs.
It solves the “Command + K” problem, but it also introduces new trade‑offs:
For a deeper dive into this style of solution, there are blog posts that explore extracting link URLs from rich‑text cells in detail. One example is a guide on “extracting URLs from hyperlinks in Google Sheets” that walks through the Apps Script approach step by step.
---
3. A faster workflow when you only need a list once
In many real‑world cases, you do not need a permanent formula or script. You simply want a clean list of URLs so that you can:
Instead of fighting with formulas, you can treat URL Extractor as a side‑tool next to Google Sheets.
Step 1 – Select and copy the cells with hyperlinks
Sheets usually places both plain text and HTML into your clipboard. URL Extractor uses the HTML part where it can.
Step 2 – Paste into URL Extractor
If your clipboard preserved rich text, URL Extractor can see the underlying `href` values even when Sheets only shows labels.
Step 3 – Convert plain‑text URLs if needed
If the sheet only contains raw URLs with no hyperlink formatting:
This step makes the later extraction more consistent, regardless of how the sheet was originally formatted.
Step 4 – Click **GET URL** to build the list
Instead of scanning cell by cell, you now see every link in one structured list.
Step 5 – Clean, copy, or open the links
Use the list as a small workspace:
When you are finished, click Clear and repeat the same steps for the next batch of cells.
---
4. When to choose formulas, scripts, or URL Extractor
Different methods make sense in different situations:
- Every link is created with a formula.
- You want a URL column that updates automatically as formulas change.
- Many cells use Command + K or rich‑text links.
- You are comfortable maintaining script code in the spreadsheet.
- Other collaborators understand what the custom function does.
- You just need a one‑time export of URLs from a sheet.
- Links are scattered across different ranges, tabs, or formats.
- You want to review, clean, and act on links in bulk without writing formulas or scripts.
You can also mix these approaches. For example, use URL Extractor to explore what links exist, then later add a formula‑based column for the subset of data that needs to stay dynamic.
---