# Getting error using AVERAGEIFS in Google Sheets

I am trying to get the average score that team members in Team 3 in a given quarter gave for a question.

Column D contains team names, Column E contains the scores (on a 0-10 range). Column AK contains the quarter the team answered in (e.g. FY22 Q4). Here is my query:

=​AVERAGEIFS(\$D\$2:\$D\$2402, E\$2:E\$2402, "Team 3", '\$AK\$2:\$AK\$2402, "FY22 Q4")

The error I get is: "Evaluation of function AVERAGEIFS caused a divide by zero error."

• Keep in mind that we can't see your spreadsheet. Asking the volunteers here to "imagine it" will be a deterrent, as the time any of us can donate is limited. Help us help you by sharing a link to a sample spreadsheet showing us what you're trying to tell us currently. Feb 28, 2022 at 14:36
• did you notice that there is a stray apostrophe in your formula? --> '\$AK\$2:\$AK\$2402 Feb 28, 2022 at 17:38

The correct query to use is:

``````=AVERAGEIFS( E2:E2402, D2:D2402,"Team 3", AK2:AK2402 ,"FY22 Q4")
``````

that is (order of elements):

``````scores teamNames teamType quarters quarterType
``````

...maybe even adding an error check with

``````=iferror( AVERAGEIFS ( E2:E2402, D2:D2402,"Team 3", AK2:AK2402 ,"FY22 Q4"),"")
``````
• Thanks. Just sharing a sheet with sample data and sample results: docs.google.com/spreadsheets/d/… Is there a better approach than what I'm thinking to achieve these results? Mar 1, 2022 at 12:20
• @user1916846 just now adapted the calculation to your sample sheet Mar 1, 2022 at 16:14
• Perfect thank you very much Mar 26, 2022 at 16:09