Wednesday, July 17, 2013

Google Spreadsheet Simple Group by Query

Question:

( by Rashi Gadia )



Hi All,


I've been stuck on how to built a formula to count the values based on the multiple criteria from one worksheet to another. On the first sheet I've two columns something like this:

Sheet 1
Column 1              Column 2
High                         First
High                         First
Medium                    First
High                         Second
Sheet 2

Column 1    Column 2               Total
High           First                        2
Medium      First                         1
High           Second                    1

I'm trying to use this formula =QUERY('Bug Report'!H:K,select Count('Bug Report'!H) where 'Bug Report'!H=C3 and 'Bug Report'!K=D3) and it gives me a parser error.

Please advise, any help would be highly appreciated.

Thanks and regards,

Rashi



Solution:

Have a look at the following screenshots of my spreadsheet:

Sheet 'Bug Report':



Sheet 2:





I have the following formula in Cell A1 of sheet2:

=query('Bug Report'!A:C;"select A,B,count(C) where A<>'' group by A,B label count(C) '' ")

the above formula will give you the group by results from Sheet 'Bug Report'.

You can also put the above formula on any other sheet.


I hope the above solution will help you, and if you need more help then please do comment below on this blog itself, I will try to help you out.

I also take up private and confidential projects:
If this blog post was helpful to you, and if you think you want to help me too and make my this blog survive then please donate here: http://igoogledrive.blogspot.com/2012/09/donate.html 

Thanks,

No comments:

Post a Comment