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

Поделиться
HTML-код
  • Опубликовано: 5 авг 2017
  • 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/sheets/about/
    Website:
    www.chicagocomputerclasses.com/

Комментарии • 70

  • @jackson35bmx
    @jackson35bmx 4 года назад +2

    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 !!!

  • @FlyingNutcase
    @FlyingNutcase 6 лет назад +5

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

  • @justfly2525
    @justfly2525 5 лет назад +1

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

  • @jamieheiney8901
    @jamieheiney8901 4 года назад +1

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

  • @fcbhadi77
    @fcbhadi77 2 года назад +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!

  • @t.wilson
    @t.wilson 3 года назад +1

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

  • @zr2ee1
    @zr2ee1 6 лет назад +3

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

  • @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!

  • @feng-huo
    @feng-huo 3 года назад +1

    Great video, thanks

  • @profocelsomarin4123
    @profocelsomarin4123 Год назад

    seus vídeos são incrivelmente didáticos

  • @user-fs8qx2jx3c
    @user-fs8qx2jx3c 4 года назад

    The Best!!!

  • @andresanper
    @andresanper 10 месяцев назад

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

  • @user-ez2bf8yd7d
    @user-ez2bf8yd7d 7 месяцев назад

    Great work!

  • @aroldovillarreal7442
    @aroldovillarreal7442 4 года назад +1

    This is amazing

  • @mochannel2482
    @mochannel2482 7 месяцев назад

    Great tutorial Many thanks

  • @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?

  • @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..

  • @vangespracklin6610
    @vangespracklin6610 3 года назад +2

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

  • @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

  • @user-ti3xw4rs7e
    @user-ti3xw4rs7e 11 месяцев назад

    Very helpful!

  • @user-xl5su6zi9o
    @user-xl5su6zi9o 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.

  • @biaotang5011
    @biaotang5011 6 лет назад

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

  • @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

  • @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

  • @tipstechno6139
    @tipstechno6139 Год назад

    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

  • @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

  • @troyjanagujar3384
    @troyjanagujar3384 3 года назад +1

    lets gooo

  • @koungsareth8623
    @koungsareth8623 3 года назад

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

  • @AldousBlue
    @AldousBlue 4 года назад

    Can countif works with query?

  • @roshandandgavhal1715
    @roshandandgavhal1715 Год назад

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

  • @arfanariyanto297
    @arfanariyanto297 Год назад

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

  • @cuneiformscript2665
    @cuneiformscript2665 4 года назад

    🙏🏻

  • @fahadcarparts6201
    @fahadcarparts6201 5 лет назад +6

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

  • @nikhilthomasa5386
    @nikhilthomasa5386 7 месяцев назад

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

  • @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

  • @mawcode
    @mawcode 9 месяцев назад

    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.

  • @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.

  • @arifhaiman5
    @arifhaiman5 4 года назад

    Like it

  • @78ivor
    @78ivor 3 года назад

    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

  • @abhinavvijay1
    @abhinavvijay1 5 лет назад

    can you please share a sample sheet

  • @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.

  • @tilionlu5693
    @tilionlu5693 5 лет назад

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

  • @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)

  • @taci22boy
    @taci22boy 4 года назад

    why i cant group/pivot without AGG

  • @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.

  • @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.

  • @fabioSarmi
    @fabioSarmi 4 года назад

    HOW CAN I GET THE LAST SALE OF FELIPE WEBER?

  • @achalpriyadarshi6825
    @achalpriyadarshi6825 4 года назад

    how to get sales in Millions with above formula?

  • @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.

  • @lv_music_creation3156
    @lv_music_creation3156 2 года назад

    Provide practices sheet