TransWikia.com

How to filter out empty cells in Google Sheets with Query & Importrange

Web Applications Asked on November 26, 2021

I am trying to use this formula but it’s not working. Do you hava an idea why?

QUERY(IMPORTRANGE("IMPORTEDDATASHEET";"06_20!M:AJ");"SELECT SUM(Col17) WHERE Col1 = 'Company Name' AND Col23 <> ' ' label SUM(Col17) ''")

I want to filter by a specific company name in Col1 and filter out all empty cells in Col23 and then sum up Col17.

I also tried IS NOT NULL and != ' ' instead of <> ' ', it didn’t work either.

One Answer

You have an aggregate — SUM(Col17) — which means you need to GROUP BY some column (e.g., add GROUP BY Col1 to the QUERY before LABEL). If you don't tell the QUERY how to organize (i.e., GROUP) the aggregate function, it will throw an error.

Answered by Erik Tyler on November 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP