Google Sheets QUERY with IMPORTRANGE returns empty result when filtering data

I need help with combining QUERY and IMPORTRANGE functions in Google Sheets. I’m trying to connect two different spreadsheets and only pull rows where a specific column matches a certain value.

My goal is to import data from another spreadsheet but only show rows where the “TYPE” column equals “ABC”. However, when I run my formula, I get “Query completed with an empty output” message.

Here’s the formula I’m currently using:
=query(IMPORTRANGE("spreadsheet_url","Sheet1!A1:F25"),"select * where Col1='ABC'",0)

I want to exclude any rows that start with “XYZ” in the first column and also hide that first column from my final results. The source data has the filter column in the first position, but I only want to see the remaining columns in my destination sheet.

Any suggestions on what might be wrong with my approach?

Your formula syntax is incorrect. To filter by TYPE while excluding the first column from the results, you should adjust the column references and select only the columns you want to display. Try using this formula: =query(IMPORTRANGE("spreadsheet_url","Sheet1!A1:F25"),"select Col2,Col3,Col4,Col5,Col6 where Col1='ABC'",0). This assumes TYPE is in column A and you want the data from columns B through F. Also, ensure that the values you’re searching for are exactly ‘ABC’, as Google Sheets is case sensitive and will not match if there are extra spaces or capitalization differences. I’ve encountered issues in the past with trailing spaces affecting matches.

yeah, first make sure to allow access for IMPORTRANGE! just use =IMPORTRANGE("spreadsheet_url","Sheet1!A1:F25") on its own, and hit allow when it prompts. then put your query back in. also, double-check that “TYPE” is in column 1 - might need to tweak that.

Had this exact issue last month - drove me crazy for hours. Usually it’s formatting or invisible characters in your source data that don’t match your query criteria exactly. What worked for me was using TRIM to clean up spaces: =query(IMPORTRANGE("spreadsheet_url","Sheet1!A1:F25"),"select Col2,Col3,Col4,Col5,Col6 where trim(Col1)='ABC'",0). Also check if your TYPE values have different cases - you might need UPPER or LOWER functions like where upper(Col1)='ABC' to catch variations. Double-check that your data range actually contains what you think it does. Sometimes the imported range is smaller than expected or the data’s in different columns.