I need some assistance with a Google Sheets formula that can help me see how each row relates to the average of its group. Currently, my data looks like this:
player score level points type group_id
max 800 12 900 attack abc123
john 600 11 700 attack abc123
kate 500 10 600 attack abc123
tom 400 8 500 attack abc123
I have managed to calculate group averages using this formula:
=Query(A:F, "select F, avg(B), avg(C), avg(D) where F is not null and E='attack' group by F",-1)
This results in:
group_id avg_score avg_level avg_points
abc123 575.00 10.25 675.00
However, I am looking to show each row with extra columns that indicate the percentage of each score relative to its group average. For instance, max’s score of 800 should appear as 139%, calculated by 800/575 = 1.39. Can I adjust my QUERY formula to do this, or is a different method necessary?