Google Sheets QUERY - SUM, AVERAGE, COUNT, GROUP BY Aggregate Functions Tutorial - Part 5

Поділитися
Вставка
  • Опубліковано 12 вер 2024
  • Video tutorial series about QUERY function in Google Sheets.
    In this tutorial we'll cover how to use QUERY function in Google Sheets to get aggregate data using SUM, AVG, COUNT functions and Group By Statement.
    Google Sheets
    www.google.com...
    Website:
    www.chicagocom...

КОМЕНТАРІ • 70

  • @jackson35bmx
    @jackson35bmx 4 роки тому +3

    SIMPLICIDADE NA AULA!!! MASSA!!! Essa função query é poderosa!!! manipulação de dados incrível !!! Vou refazer toda minha planilha com esses métodos do query.
    Parabéns Excelente aula !!!

  • @jamieheiney8901
    @jamieheiney8901 4 роки тому +1

    All your videos are great!!! Clear, easy to follow and informative!

  • @fcbhadi77
    @fcbhadi77 3 роки тому +1

    This is actually cool that you can use SQL in Google sheets but I find that pivot table is way easier to get the same results. Great video!

  • @FlyingNutcase
    @FlyingNutcase 7 років тому +6

    No comments? Wow! This is very clearly stated; easy to follow. Thank you. ~ Subbed.

  • @t.wilson
    @t.wilson 3 роки тому +1

    Clear, quick, and well done. Thank you for the great video!

  • @andresanper
    @andresanper Рік тому

    Great set of tutorials! Would love to see a query with the LAG function if that would work

  • @justfly2525
    @justfly2525 5 років тому +2

    Thanks so much! I've been trying to do this forever!

  • @vangespracklin6610
    @vangespracklin6610 3 роки тому +2

    is there a way to SELECT sum(F) without the column header "sum" popping up above the returned data?

  • @feng-huo
    @feng-huo 3 роки тому +1

    Great video, thanks

  • @mochannel2482
    @mochannel2482 9 місяців тому

    Great tutorial Many thanks

  • @user-ez2bf8yd7d
    @user-ez2bf8yd7d 9 місяців тому

    Great work!

  • @zr2ee1
    @zr2ee1 6 років тому +3

    can you re-label sums and averages and count headers like you can with standard Query functions?

  • @lokfungsun5812
    @lokfungsun5812 6 років тому +1

    Thank you! Your video saved me! I missed that "D" in 5:55 after "group by" in my work and everything goes wrong. Thanks a lot!
    p.s. I wrote ="select C, D, count (E), group by C" and it returns "#VALUE!", annoyed me for a while..

  • @profocelsomarin4123
    @profocelsomarin4123 Рік тому

    seus vídeos são incrivelmente didáticos

  • @user-ti3xw4rs7e
    @user-ti3xw4rs7e Рік тому

    Very helpful!

  • @aroldovillarreal7442
    @aroldovillarreal7442 4 роки тому +1

    This is amazing

  • @fahadcarparts6201
    @fahadcarparts6201 5 років тому +6

    =QUERY(BIGTHANX,"SELECT B,E,F WHERE E > 'THANK YOU ",1)

  • @antcannon
    @antcannon 2 роки тому

    Very helpful! What if I want to see the State that had the max sale in all regions in a table that only returns each region once and the state that sold the most?
    Having to group or aggregate each select is not producing the results I want.
    Region | State | max(Sale)
    Midwestern | IL | (highest sale in midwestern)
    Northeastern | MA | (highest sale in Northeastern)
    etcetera

  • @시현윤슬
    @시현윤슬 6 років тому

    thanks. it was a nice video. I am curious about "group by" . does it only work in english? actually I have dealt with some data with korean letters. but it didn't work at all. I am sure that there is no error in syntax. I did same things what you explained.

  • @troyjanagujar3384
    @troyjanagujar3384 3 роки тому +1

    lets gooo

  • @tipstechno6139
    @tipstechno6139 2 роки тому

    thanks you for your tutorial, could you show me, how to make where statement in googlesheet for more than one criteria or base on range criteria, like statement where in('a','b') for sql language

  • @roshandandgavhal1715
    @roshandandgavhal1715 Рік тому

    If I wish to select sumif(credit), sumif(debit) credit and debit are type in same coulmn

  • @nikhilthomasa5386
    @nikhilthomasa5386 9 місяців тому

    Can we use these aggregare functions with WHERE clause or HAVING clause?

  • @conhecimentoativo
    @conhecimentoativo Рік тому

    I need but not work...
    =QUERY('names'!$A$2:D; "SELECT A, Sum(B) Where (A '') AND Sum(B)>0 Group By A, D"; 0)
    SHOW ERROR: CANNOT_BE_IN_WHERE: SUM(`B`)
    It doesn't allow putting SUM() in the WHERE. Is there an alternative to achieve this? I want to pull values ​​that are greater than 0 and I don't want to pull empty cells that aren't empty

  • @mawcode
    @mawcode 11 місяців тому

    I want to get results by searching for keywords (be it upper case or lower case), in various columns. Maybe it will find the keyword in column D, maybe F, maybe G... How can I do that? Currently, I use various IFERROR, FILTER, ISNUMBER, SEARCH in just one formula. I am guessing it can be done through QUERY, but I still do not get it.

  • @koungsareth8623
    @koungsareth8623 3 роки тому

    please produce more about the group by date, month, product, and subtotal.

  • @leonardofwink
    @leonardofwink 4 роки тому

    Great video! I have a dataset with station codes, location, date and measured values of dissolved oxygen (DO), ammoniacal nitrogen, etc. Is it possible to extract the average value of DO by month? I need to correct some cases missing, and, due sazonality, the month is something important. I only managed the avg of date range between years. Greetings from Brazil! Thank you!

  • @user-fs8qx2jx3c
    @user-fs8qx2jx3c 4 роки тому

    The Best!!!

  • @amolparbat6428
    @amolparbat6428 3 роки тому

    Had a quick question on Query ....I have data in which one column has number format as " AB12234" when I use query function it's gives put as " " can you please provide resolution for this .... thank you

  • @PietroAvanzolini
    @PietroAvanzolini 4 роки тому

    What in you need to have in the second tab the list of every day of the year and in each day see the sum of the sale that match that day?

  • @samirbensaci7983
    @samirbensaci7983 3 роки тому

    Hi,
    When I add it between two columns and on one of the two columns, there are empty cells, the calculation is not done
    Can you help me plaise, thank you

  • @arfanariyanto297
    @arfanariyanto297 Рік тому

    how about if we add column to count distinct brand ? how to do that ?

  • @gaurangamin6827
    @gaurangamin6827 3 роки тому

    Hello I am using this =QUERY(AMAZON!A:AA,"SELECT C,D,N,P WHERE C = 'Order'",1) but I want to add N and P when data import

  • @suraization
    @suraization 3 роки тому

    Hi. I have learnt a lot from your videos and have a question. Is there a way where I can use the QUERY function to get the unique count of no.of sales order for a date. Ie. SO-001 would have three items and each item is entered in different rows. SO-002 would have 1 item, SO-003 would have two items. The summary sheet should have a query function that shows the count of no. of sales orders as 3 and not 6 for that date.
    Please help if possible. Thank you

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  3 роки тому

      QUERY language currently doesn't support DISTINCT, so you would have to pre-process data to remove duplicates first before grouping it.

    • @suraization
      @suraization 3 роки тому

      @@ExcelGoogleSheets Thank you for your response. Will work on it.

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  3 роки тому

      Why not just use a Pivot Table with countunique?

    • @suraization
      @suraization 3 роки тому

      @@ExcelGoogleSheets I did. But the summary sheet is an automated sheet. But when I give the pivot table a range (i.e A:F instead hardcoding A1:F520) it keeps showing an additional 0 values in the pivot table which Im assuming its the blank cells from the range. Is there a workaround for this?

    • @suraization
      @suraization 3 роки тому

      I used a filter on the pivot table to remove the 0 but then I wanted some method which is more cleaner and leaner. If that makes sense.

  • @AldousBlue
    @AldousBlue 4 роки тому

    Can countif works with query?

  • @tilianlu5693
    @tilianlu5693 6 років тому

    Thank you teacher! Have a question, can this function get aggregate data using COUNTA OR COUNTUNIQUE?

  • @maziarkarimi4383
    @maziarkarimi4383 3 роки тому

    Hi, Is there potentially any syntax error in something like this?
    =QUERY(Data_Dump!A:U, "SELECT A,B,C,D,E,F,G,H,I,J,K,L, SUM(M), N,O,P,Q,R,S,T,U GROUP BY H",1) ?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  3 роки тому

      You can't list columns without an aggregate function in SELECT if they don't appear in GROUP BY.

  • @jasondahl3167
    @jasondahl3167 4 роки тому

    I'm looking for guidance on how to pull out the following
    I want to "select A,H,I,J,K,L,M,N,O where G contains 'HDW'" but I also want to SUM(M) and GROUP by L
    If I write as follows
    Select H,I,J,K,L, SUM(M) where G contains 'HDW' group by L,K,J,I,H
    It doesn't do the group by correctly. I end up with duplicates of some of the items still. Any help would be great.

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 роки тому

      Your query looks correct.

    • @jasondahl3167
      @jasondahl3167 4 роки тому

      @@ExcelGoogleSheets
      Thanks for the response.
      It returns duplicates of L still. It has something to do with the group by L,K,J,I,H. This is somehow undoing the initial group L.
      If I just do Select L, SUM(M) where G contains 'HDW' group by L it groups everything correctly. But I need those other columns to be in this. Once I add those it starts to undo the initial group for some reason.
      I tried using one of your other tutorials where you can combine multiple QUERY's into one but that didn't produce anything different.

  • @arnopisspot5115
    @arnopisspot5115 5 років тому

    It will be great to have a video on format with the query function (like how to query results and format as currency, etc). If you agree, up vote this comment if you agree so the author notices it.

  • @78ivor
    @78ivor 4 роки тому

    Anyone have any ideas how to just add column in group by query that is not number?
    Hi, very helpfull videos.
    In more details:
    I have a problem that I can not think of a solution. I have data set witch needs to be group by.
    My problem is that I need to add extra columns to my group by query (extra data I use to see what is going on with product that I'm grouping and that extra columns are text), I just need to COPY data from multiple columns in every first row of each unique item of 'query group by' column.
    Hope I explained it well enough.
    Thx,
    Cheers

  • @taci22boy
    @taci22boy 4 роки тому

    why i cant group/pivot without AGG

  • @arifhaiman5
    @arifhaiman5 4 роки тому

    Like it

  • @NatanKawanAraujoFreire
    @NatanKawanAraujoFreire 3 роки тому

    hi, i have a function to bring me a index on google finance with a historical price of VISA stock =QUERY(index(GOOGLEFINANCE("V","PRICE","01/01/2020",TODAY()),,2),"select avg(A)") , how i can use query to do a avg in this index ? i try do somethings but this dont work, google show me a message like "the column A dont exist". someone can help me ?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  3 роки тому

      =QUERY(index(GOOGLEFINANCE("V","PRICE","01/01/2020",TODAY()),,2),"select avg(Col1)")

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  3 роки тому

      =QUERY(GOOGLEFINANCE("V","PRICE","01/01/2020",TODAY()),"select avg(Col2)",1)

  • @abhinavvijay1
    @abhinavvijay1 5 років тому

    can you please share a sample sheet

  • @cuneiformscript2665
    @cuneiformscript2665 4 роки тому

    🙏🏻

  • @biaotang5011
    @biaotang5011 6 років тому

    is anybody have the experences how to concat multi cols to one col in query?

  • @fabioSarmi
    @fabioSarmi 4 роки тому

    HOW CAN I GET THE LAST SALE OF FELIPE WEBER?

  • @lv_music_creation3156
    @lv_music_creation3156 2 роки тому

    Provide practices sheet

  • @shrawanrathod941
    @shrawanrathod941 4 роки тому

    How to add a total row to a Query Function table

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 роки тому

      Calculate the total separately and append it as an array.

  • @achalpriyadarshi6825
    @achalpriyadarshi6825 4 роки тому

    how to get sales in Millions with above formula?