To retain the hyperlink when utilizing the =QUERY function in Google Sheets, use the following method:
- Insert a new column next to the column that contains the hyperlink.
- In the new column, use the following formula to extract the hyperlink: =HYPERLINK(A1)
- Replace the A1 with the cell reference of the hyperlink you want to extract.
- Copy the formula down the entire column.
- In the =QUERY function, refer to the new column instead of the column that contains the original hyperlink.