Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Sheets get an average value from unique values in a single column

On Google Sheets, I want to find an average for all values in rows that contain a unique value in one column. For example, I have a sheet like this:

  • Dog | 2
  • Dog | 1
  • Dog | 4
  • Cat | 3
  • Rat | 2
  • Cat | 1

And I want to create another table below it for the average value of each unique value in the row:

  • Dog | 2.33
  • Cat | 2
  • Rat | 2
like image 285
Ryan Jacques Avatar asked Sep 17 '25 07:09

Ryan Jacques


1 Answers

You can use

=QUERY(Data!A1:B7;"SELECT A, AVG(B) GROUP BY A")

assuming your data (containing titles) are on the A and B columns of the sheet.

like image 76
Barbaros Özhan Avatar answered Sep 19 '25 15:09

Barbaros Özhan