Google Sheets – Reference Cell URL When Using Filter or Query Functions

google sheetsgoogle-sheets-query

I am using functions like FILTER or QUERY to bring data from one sheet to another.

=QUERY(Data!A2:$D, "SELECT B WHERE C = 'fragment' ")

=FILTER(Data!E2:E, Data!C2:C = "fragment")

Is it possible to bring the link reference to the printed cell or row to be able to navigate to that?

It is seems that I had to turn the column text values into hyperlinks like that https://docs.google.com/spreadsheets/d/id/edit#gid=123&range=XYZ.

Do you have any ideas? May be I had to use app script for that?

Best Answer

Use an { array expression }, like this:

=filter( 
  { 
    Data!E2:E, 
    "https://docs.google.com/spreadsheets/d/id/edit#gid=123&range=E" 
    & 
    row(Data!E2:E) 
  }, 
  Data!C2:C = "fragment" 
)