Search code examples
google-sheetsgroup-bymergeconcatenationgoogle-query-language

How to merge row according to different column (is query possible ?)


I try to find a solution to merge different row and add some cells at the same time. This is a simplified example :

Data base

In this example I would like to be able to generate this for the name of "Robin Decoster"

Robin

As the name (Robin Decoster) AND the project name is the same (Grand Nord) I would like to do a sum on column E and on column F to simplify the data base.

I thought to use query methode with :

=QUERY(BD!A1:GF6;"SELECT B, sum(E), sum(F) where D='Grand Nord' AND B='Robin Decoster' GROUP BY B")

Result with query

It could works but I can't display the other Columns (AVS, Adresse, Projet Films).

Any Idea ?


Solution

  • try:

    =QUERY(BD!A1:GF6;
     "select B,C,D,sum(E),sum(F) 
      where D='Grand Nord' 
        and B='Robin Decoster' 
      group by B,C,D")