Google Sheets – How to Query and Sort by Month

google sheetsgoogle-sheets-query

I'm using this Sheetgo Attendance template on Google Sheets, but it's designed for US Schools so it's needed to sort by January to December. I will provide below the assets that I've have about it. Can someone help me with how to Query it?

Source (Google Drive): https://drive.google.com/drive/folders/1aEdUYuKHlaiCrNZShSt20swEu7u13-z4?usp=sharing

G-Sheets

Source Data (Picture): G-Sheets

Where I need to edit the Query:
Cell H-17 on tab Data Preparation Charts

The previous Query: =QUERY('Overview per month'!A:F,"SELECT A,AVG(B) GROUP BY A LABEL AVG(B) 'Presence rate'",1)

Best Answer

You can't order a query by month names because that would order them either alphabetically from A - Z or from Z - A. To achieve your ordering from January to December, you first need to create a mapping as follows:

1: January
2: February
...
12: December

Then you can order by month number to get the sorting correctly.