Is there any way populate a cell in a Google sheet based on the value in the URL?

For example: If the hyperlink below was on sheetA and the link was clicked. Is there any way to get ?cell=english into a cell in sheetB?


2 Answers 2


The event of someone clicking a hyperlink embedded in a spreadsheet is not visible to the spreadsheet itself. It cannot trigger any changes. (Unless the link is to some web application which is programmed to modify the spreadsheet).

As for extracting the URL from a cell with =hyperlink formula - this can't be done with built-in Sheets functions, but there is a custom function (implemented in Google Apps Script) which does that: see Extract the link text and URL from a hyperlinked cell.


this is not possible to do so on click-event, but it can be faked to some degree:

  • cell SheetA!A1: insert custom checkbox via data validation
  • cell SheetA!B1: =IF(A1=1, HYPERLINK("https://www.themoviedb.org/", "English"), )
  • cell SheetA!C1: =IF(B1<>"", HYPERLINK("https://www.themoviedb.org/"), )
  • cell SheetB!A1: =INDIRECT("SheetA!C1")





the other approach would be to mask that link via URL shortener like https://bitly.com/ and scrape click-count via IMPORTXML() and then use simple IF() statement in a way:
IF(IMPORTXML(imported click-count)>2(click-counts), INDIRECT("SheetA!C1"), )
to detect ocured click and fill cell SheetB!A1 - the only downside is that it's just one time trigger detector.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.