Google-sheets – How to do an aggregate function with multiple columns with a Google Sheets query

formulasgoogle sheetsgoogle-sheets-query

I've got two columns of 10 numbers in Google Sheets. I'd like to average the numbers in both columns using a Google Sheets query. Something like this:

=query(A1:B11, "select avg(A&B)", 1)  <- This does NOT work

What DOES work?

Best Answer

  • try like this:

    =QUERY(A1:B11, "select avg(A),avg(B)", 1)

  • to kill labels you can do:

    =QUERY(A1:B11, "select avg(A),avg(B) label avg(A)'',avg(B)''", 1)

  • to get average of two columns do:

    =AVERAGE(A1:B)

    0