Search code examples
imagegoogle-sheetsfiltermatchgoogle-query-language

Google Sheets: Adding images to queried cells


So what I'm trying to do is add images that show up next to certain cells while maintaining the ability to have a drop down that will sort through various columns. I want to add visuals because the community this is for speaks many different languages, and I want it to be an accessible sheet.

I've made an example of what I'm trying to do on this sheet with some placeholder images on the "Data" sheet. These images aren't carried over to the "Sorted Data" sheet. I know the query function on its own can't be used to bring images in from another sheet, so I want to know how I could get this kind of setup while maintaining images. This sheet is editable.

While looking for answers, I found this: Google Sheets Query Image to show up from Query result

It's the closest I've seen. I'm struggling, however, on how I might translate this to what I'm trying to do here in terms of sorting the data. I've also seen people say some functions don't work with a lot of images, only loading a few. I'm not sure how true that might be, but just in case it's relevant, there likely will be a lot of images on this sheet.

I'm completely open to anything I may have missed, any changes I could make, any other functions, and script if necessary.


Solution

  • query is not suitable for this job. use:

    =SORT(FILTER(Data!B3:W500, Data!C3:C500<>""))
    

    enter image description here


    =SORT(FILTER(Data!B3:W500, Data!C3:C500<>""), MATCH(Z3, B2:2, 0), IF(AA3="ASC", 1, 0))
    

    enter image description here