Search code examples
google-sheetsgoogle-sheets-formulagoogle-sheets-querygoogle-query-languagecount-unique

Counting unique and group by from multiple spreadsheet


I have problem in processing my data. I need to query unique ID from multiple sheets and group by specific criteria.

Here's the google sheet example so you can see the context

https://docs.google.com/spreadsheets/d/1Pudng2o1JjHpapFrxfciyZMRzodRRG9eroCl1yMb9vE/edit?usp=sharing

Looking forward for the help!


Solution

  • try:

    =QUERY(UNIQUE({Sheet1!A2:B; Sheet2!A2:B; Sheet3!A2:B}), 
     "select Col2,count(Col2) 
      where Col2 is not null 
      group by Col2
      label count(Col2)''", 0)
    

    0