How to keep the hyperlink while using =QUERY formula in google spreadsheet?
The query
function only supports certain data types:
Supported data types are string, number, boolean, date, datetime and timeofday.
It doesn't handle other things one might embed into a spreadsheet, such as images or hyperlinks. (Hyperlinks are coerced to strings.) After all, the query language is not something Sheets-specific, it has its own data models that interact with Sheets only to an extent.
A solution is to use filter
instead of query
, if possible. It can do many of the things that query
does. For example,
=QUERY(Tab!6:1963,"select C where (E='Major' and D >= now())")
can be replaced by
=filter(Tab!C6:C1963, (Tab!E6:E1963="Major") * (Tab!E6:E1963 >= now()))
which will return the links as expected. (And even images inserted with =image()
if you got them.) The multiplication operator is logical and in the filter formula.